Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

For c++, which include file is needed to use the fscanf_s function?

0 votes
asked Jun 25, 2020 by srh (120 points)
Also, which version of C++ does fscanf_s work in? (C++, C++11, C++17?)

1 Answer

0 votes
answered Jun 25, 2020 by Peter Minarik (88,520 points)
edited Jun 26, 2020 by Peter Minarik

Please, read the documentation: http://www.cplusplus.com/reference/cstdio/fscanf/

As you see, fscanf is declared in the <cstdio> (in C++, or stdio.h for C) header.

fscan_s is not part of the standard. It's implemented by Microsoft (see documentation) so OnlineGDB doesn't recognise it.

Therefore, the second part of the question (which C++ supports it) is invalid, as, again, the standard does not support it, it's only available on Microsoft operating systems. (OnlineGDB is not one of them.) Specifically on Microsoft platform, I'd assume, all C++ versions would support it, but again, only on their platforms.

commented Jun 25, 2020 by srh (120 points)
Makes sense...I didn't know it was Microsoft specific...just what I needed to know...Thanks.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.