samedi 31 octobre 2015

how to separate entering data to C program: bit from file, bit from keyboard?

I've some C program which must first load numbers from file to array and then allow user to enter different numbers and check if they exists in red array. Executing happens using command line:

program.exe < numbers.txt

Reading from file is done so

for (t = 0; t < n; t++){//n is array count set before
        scanf("%d", &values[t]);
    }

So the problem that program starts with data from file and finishing without possibility to enter any data from keyboard. How can I make this able to be?

Aucun commentaire:

Enregistrer un commentaire