Jump to content

iostream vs stdio.h


Recommended Posts

I have always used iostream to print to the command line in my programs because that is what I was taught from the tutorials and books I have read. But when I was talking about it with my brother who is a C++ programmer, he was not familiar with iostream. He told me that he uses stdio.h, I think he referred to it as standard input/output.

So I did some looking around and found a "hello world" tutorial using stdio.h and was wondering which would be better for me to practice. Is one more preferred in general? Are there any benefits to one over the other?

#include <iostream>
using namespace std;

int main()
{
cout << "Hello World!";
return 0;
}

#include <stdio.h>

int main()
{
printf("Hello World!");
return 0;
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy