السلام عليكم و رحمة الله و بركاته
شكرا لكم و أتمنى مساعدتي في تصحيح الكود:
: Write a program to find the number of bytes in an array of size 20. Use the size of operator, pointer and function
بصراحة لم يتضح لي السؤال جيدا
حللته بهذه الصيغة لكن لا أعلم هل الحل ينقصه شيء أو لا ؟
#include<iostream>
#include<conio.h>
using std::cout;
using std::endl;
size_t getsize(double *);
int main()
{
double array[20];
cout<<"the number of bytes in the array is "<<sizeof(array);
cout<<"\nthe number of bytes returned by getsize is "<<getsize(array)<<endl;
getch();
return 0;
}
size_t getsize(double *ptr)
{
return sizeof(ptr);
}من لديه الحل فليساعدني و له الأجر ..
و شكرا لكم

