How to convert from C to C++

Hi guys I came across one question How can I write scanf("%ld" &n)
which is in C into C++ language.
Aside from that, scanf is one of the functions that also exist in C++ (in the header cstdio instead of stdio.h), but you should use iostreams instead (introduction at the link fire posted).

PS: I know you used iostreams earlier... is it just that you wanted to know what scanf does or what?
Last edited on
No I mean this %ld what does it mean in C. And how can I write it in C++
%ld means long decimal integer, which is a long int in C++ (in C too by the way). It's the scanning format scanf uses to retrieve input, and you don't need that in c++ cause you got iostreams.
Last edited on
Thanks hanst99 I understood, :)
Use iostream if you want your exe to be 450kb bigger :) (and even if do NOT USE it, by simple inclusion of <iostream> header the executable size grow that much).
modoran, then your compiler sucks or you are simply to incompetent to let your compiler strip debugging information. Sad but true.
Topic archived. No new replies allowed.