a flowchart then search for needed stuffs then implement todos one by one.
first question why you need to store 15 expected 1 digit numbers in 15, 100 bytes len buffers? you can use 1, 16 bytes buffer like this
char buf[16] = {0};
read(1, buf[i], 1); in loop
or read all at once
read(1, buf, 15);
then
if (buf[n] == '7' && ...)
or simply
if (strcmp(buf, "wanted_number") == 0)
or
if (atoi(buf) == wanted_number)
do stuffs
fgets
Обсуждают сегодня