i have this code looks like the sizeof(skyline) returns always 8 and when deviding it with sizeof(int) that is 4 give me wrong array size . The code :
int calcualteSkyLine(const int* skyline)
{
int arrSize = sizeof(skyline) / sizeof(int);
for(int i=0;i <=arrSize;i++)
{
std::cout << skyline[i] << std::endl;
}
}
int main(int argv,char** argc)
{
const int buldingArry[] = {1,3,2,1,2,1,5,3,3,4,2};
calcualteSkyLine(buldingArry);
return 0;
}
arrSize is always 8 .. therefor the array cant be printed , what is wrong here ? if i replace the "arrSize" with 10 all works