0

I have been reading older C programs to try and understand how to convert them to C++. One particular line of code still confuses me however.

fscanf(fin, "%d", &n)

I understand that fscanf reads from the stream (the file pointed to by fin), it reads the data which will be decimals (%d), and stores the data in n. Is this correct? Also, what would be the C++ equivalent of this. I have read the documentation of fscanf at www.cplusplus.com but I just need clarification.

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by demroth
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.