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.
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.Code:char line; int value; fgets(line, sizeof(line),stdin); sscanf(line, "%d", &value);
Also, does this slow the program down at all?
Thanks for any info