Forum: C++ Jun 3rd, 2005 |
| Replies: 28 Views: 45,636 I tried using the sizeof operator as suggested above. But everytime for an int array it gives "1" as output and for a char array it gives "4". No matter how many elements I store in the array.
I... |
Forum: C++ May 31st, 2005 |
| Replies: 28 Views: 45,636 I guess this would be helpful,
/******for a static array********/
char inp[4];
for (n=0;inp[n];n++)
; //do nothing inside the loop
cout<<n; //n will display the number of elements in the array... |