Just a quick question iam getting my input from a text file by doing ./a.out <intial.txt
the input for example 1 2 3 a or 1 2 a 3
I want to be able to read all the numbers in and when I get to a store that in my array as zero. Here is the code I have so far
int array[100];
int number;
int count=0;
while (scanf("%d",&number)==1){
array[count]=number;
count++;
}
This is in C

New Topic/Question
Reply




MultiQuote



|