background preloader

Programming Java,code,script and C ++

Facebook Twitter

C++ Tutorial - Learn C. Learn to Program for Windows in C++ Welcome to the series Learn to Program for Windows in C++. The aim of this series is to teach you how to write a Windows program in C++. In the first module, you'll learn step-by-step how to create and show a window. Later modules will introduce the Component Object Model (COM), graphics and text, and user input. For this series, it is assumed that you have a good working knowledge of C++ programming. In This Section Build date: 10/5/2010. The Best Hacking Tutorial Sites - Learn Legal Hacking. Java.

Google C++ Style Guide. Definition: Streams are a replacement for printf() and scanf(). Pros: With streams, you do not need to know the type of the object you are printing. You do not have problems with format strings not matching the argument list. (Though with gcc, you do not have that problem with printf either.) Streams have automatic constructors and destructors that open and close the relevant files. Cons: Streams make it difficult to do functionality like pread(). Some formatting (particularly the common format string idiom %. *s) is difficult if not impossible to do efficiently using streams without using printf-like hacks.

Decision: Do not use streams, except where required by a logging interface. There are various pros and cons to using streams, but in this case, as in many other cases, consistency trumps the debate. Extended Discussion There has been debate on this issue, so this explains the reasoning in greater depth. Cout << this; // Prints the address cout << *this; // Prints the contents.