Hi, I am still new to c so this might sound like a basic question. Up till now i have been using scanf to store user inputted numbers into int and float ect. I am reading a book called Practical c programming 3rd ed. In its chapter on reading numbers it says that scanf is useless except to expert users and its better to use fget to read numbers.
eg
Code:
char line[100];
int value;
fgets(line, sizeof(line),stdin);
sscanf(line, "%d", &value);
Is that how most people do it? Its just that is the first time i have seen this used and i was wondering if this practice was out dated.
Also, does this slow the program down at all?
Thanks for any info