The line int main is the main function where program

This preview shows page 4 - 7 out of 14 pages.

The line int main() is the main function where program execution begins. The next line cout << “Hello World"; causes the message “Hello World" to be displayed on the screen. The next line return 0; terminates main( )function and causes it to return the value 0 to the calling process.
Image of page 4

Subscribe to view the full document.

Program comments are explanatory statements that you can include in the C+ + code that you write and helps anyone reading the source code. All programming languages allow for some form of comments. C++ supports single-line and multi-line comments. All characters available inside any comment are ignored by C++ compiler. Single Line Comment: // This is a comment // Multi Line Comment: /* C++ comments can also span multiple lines */ Comments
Image of page 5
C++ uses a convenient abstraction called streams to perform input and output operations in sequential media such as the screen, the keyboard or a file. C++ I/O occurs in streams, which are sequences of bytes. If bytes flow from a device like a keyboard, a disk drive, or a network connection etc. to main memory, this is called input operation and if bytes flow from main memory to a device like a display screen, a printer, a disk drive, or a network connection, etc, this is called output operation .
Image of page 6

Subscribe to view the full document.

Image of page 7
  • Spring '16
  • dncj ncnd
  • namespace std, Program Execution

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern