I
Ian Tuomi
Say I have an array: int foo[] and it has an unknown number of integers
in it. How can I find out how many? I tried:
#include <stdio.h>
int ArraySize(int array[])
{
int i = 0;
while(array != NULL) i++;
return i;
}
int main(void)
{
int count;
int intarray[10];
for(count = 0;count<=10; ++count)
{
intarray[count] = count;
}
printf("\nintegers in intarray[10] == %d\n", ArraySize(intarray) );
return 0;
}
but it just outputs "integers in intarray[10] == 0". So this must be
very wrong. thanks in advance.
--
Ian Tuomi
Jyväskylä, Finland
"Very funny scotty, now beam down my clothes."
GCS d- s+: a--- C++>$ L+>+++$ E- W+ N+ !o>+ w---
!O- !M- t+ !5 !X R+ tv- b++ DI+ !D G e->+++ h!
NOTE: Remove NOSPAM from address
in it. How can I find out how many? I tried:
#include <stdio.h>
int ArraySize(int array[])
{
int i = 0;
while(array != NULL) i++;
return i;
}
int main(void)
{
int count;
int intarray[10];
for(count = 0;count<=10; ++count)
{
intarray[count] = count;
}
printf("\nintegers in intarray[10] == %d\n", ArraySize(intarray) );
return 0;
}
but it just outputs "integers in intarray[10] == 0". So this must be
very wrong. thanks in advance.
--
Ian Tuomi
Jyväskylä, Finland
"Very funny scotty, now beam down my clothes."
GCS d- s+: a--- C++>$ L+>+++$ E- W+ N+ !o>+ w---
!O- !M- t+ !5 !X R+ tv- b++ DI+ !D G e->+++ h!
NOTE: Remove NOSPAM from address