Use pointer to const to display an array of non constant values of type double ?

#include<iostream>
using namespace std;

void fun(const double *ptr, int size);

int main()
{
const int size=5;
double array[size]={9,5,3,4,6};
fun(array, size);
return 0;
}

void fun(const double *ptr, int size)
{
for(int i=0; i<size; i++)
{
cout << *ptr << endl;
ptr++;
}
}