Generally I have come across "hello world" tutorials that use the iostream library, but when I was talking about it with my brother who is a C++ programmer, he was not familiar with it. He told me that he uses stdio.h, or 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. Are there any benefits to using one or the other?
Yeah, seriously. iostream is almost as old as C++, so either he learnt C++ during its early development stages in the 80s, or he thinks C and C++ are essentially identical.
As for which is better, it doesn't matter much. It's just a Hello World. The one that uses iostream is the C++ way, though.
He probably thinks he codes in C++ but is actually a C-based programmer. Still, most C programmers at least know the basics of C++ so I dunno.
EDIT: Also, we didn't answer his question. He asked if there was a difference as in is one optimized over the other. I don't know the answer so I can't give one.
Sorry, maybe my brother is a C programmer. I am a newbie programmer so I am still learning.
So, when it comes to cstdio and iostream, it's just a matter of preference? They are both used for the same thing? Is one more cross-platform than the other?
I suppose you could call it a matter of preference. Yes, they are used for essentially the same thing, and they are equally cross-platform. However, iostream trumps stdio in a lot of ways. Read the links I gave you.
Sort of. Neither can do more than the other (at least not as far as I know), but like I said before, iostream is the C++ way. C++ classes, however, do provide more memory-safety mechanisms than C, and that's always a plus.
Thank you everyone, I understand much better now. I'm going to continue to practice with iostream but will definitively learn how to use cstdio as well.