+ 2
what is difference between <iostream>. <stdio.h>
2 odpowiedzi
+ 7
<iostream> is C++ standard library
<stdio.h> is C standard library
they are cross platform
example:
(C++)
#include <iostream>
using namespace std;
int main (){
cout << "Hello World" << endl;
return 0;
}
example (C)
#include <stdio.h>
int main (){
printf ( "Hello World");
return 0;
}
same output using different libraries
you'll be using <iostream> since this is a C++ course not C but you can use either since C++ is just an addition of C, depends on what you want to do.
+ 7
Both are different header files which are used to include certain file in a program.
<iostream.h> is the input output stream which manages the cin and cout statements in our program.It also manages close, flush , get , clear , peek , etc functions .
<stdio.h> defines types and macros needed for the standard I/O package. Its functions include getw , printf , rewind , clearerr , gets , puts , vprintf , and many more ....