Structs or classes?

Started by
29 comments, last by DarkEcclipse 24 years ago
Yes Kylotan,
And furthermore, streams are extendible, which printf and friends are not. Want to print out that data structure you just finished writing? Ok, you can sit there with printf and manually print every last data member, or you can overload operator<< and use it in streams like everything else. Sure, you can write a function to use fprintf to print all the members, but it makes all of your code VERY inconsisent and much more difficult to use. I''ll admit that some of the formatting controls in the streams library are a little wierd, but the numerous benefits far outweigh the disadvantages when compared to C-style IO.

-Brian

This topic is closed to new replies.

Advertisement