Hi,
I am trying to use the isdigit function to extract digits from an array containing a string file. What I am wondering is if the variable used in it can be a char?
this is what I have,
for(k=0;k<10;k+ +)
{
i = student [k];
if( isdigit(i))
num [j] = i;
j++;
printf("%s",num );
}
For some reason it is printing weird characters repetivaly as if it is not looping through the whole student array.
any help is greatly appreciated.
I am trying to use the isdigit function to extract digits from an array containing a string file. What I am wondering is if the variable used in it can be a char?
this is what I have,
for(k=0;k<10;k+ +)
{
i = student [k];
if( isdigit(i))
num [j] = i;
j++;
printf("%s",num );
}
For some reason it is printing weird characters repetivaly as if it is not looping through the whole student array.
any help is greatly appreciated.
Comment