hi i wrote this code which is written bellow when ever i check the value of u it appear to be the 3. while it is supposed to be 8. Can any body tell me what is the problem with this code and how can i get the exact size of the arrgument of func.
void main(){ func("fara.txt"); } void func(unsigned char arr[]){ int u; u=sizeof(arr); }
"But "sizeof X" would also be correct." If X is a type name, parentheses are required. In fact, it is only when the sizeof operator is used to obtain the size of a type, that the parentheses are required.