Hello,
I'm learning C++ in my Programming Methodology class. My professor is using the compiler directive #include <stdio.h>, but my book uses #include <iostream>. My professor's programs use totally different commands and syntax than my text book. Could someone please explain to me the difference between the two? Does one require different syntax than the other? For example, he uses things printf("real number: %3.3f\n", x) instead of the cout<< stuff, and I have no idea what the % sign or the f\n are for. If someone could find a list of corresponding commands for each one, I'd be set. Please help!
Thank you.
stdio.h is form c standard library, iostream is from c++ standard library. Note that if you want to use stdio.h in c++ programs it would be better to include cstdio instead.
As for printf, see http://www.cplusplus.com/reference/clibrary/cstdio/printf/
yap.. like hamsterman said, #include <stdio.h> i for C programming language, #include <iostream> is for c++... in c is printf and scanf, in c++ is cout and cout and cin :)))