Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

CPP

Name: Anonymous 2011-11-27 10:04

Hi,

is it a good practice to write this #def in cpp?

#define print(X) std::cout<<X<<std::endl

so that it can be used as:

print("what " << "ever" << " I " << "want");

btw.. how do I insert sniplet of code here?

Name: Anonymous 2011-11-27 10:16

>>4
Build two small program that print hello world, one using printf, the other using cout. Compare the difference in size of the resulting binaries. C++ iostreams are bloated and slow.

>>5
printf is a POSIX function, it's in both POSIX and the Standard C specifications. write doesn't do text based formatting and conversion of integers/floats to text.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List