Thread: c++ functions

  1. #1
    Registered User
    Join Date
    Jan 2006

    c++ functions

    I am just begining to learn c++ and was wondering what these functions do;

    -main (followed by () )
    Also I was wondering what is the proper pronunciation for c++:
    c plus plus or c positive positive?

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    New York
    Think logically, it's pronounced C-plus-plus

    main() defines the entry point of your application, and is required. cout is an instance of the ostream class which writes to the output stream stdout, what you see. The overloaded opearator << writes to the stream. cin is an instance of the istream class which reads data from the input stream stdin. The overloaded operator >> reads from the stream until it encounters whitespace. Overloaded operators are a feature of the C++ language, so instead of a statement like:

    3 + 4

    using the '+' operator to which took two integer arguments (3 and 4), and added them, you can make statements like this with operator overloading:

    cout << "Hello World!"

    Which took the ostream cout class and a literal string "Hello World" and wrote it to stdout. These concepts will be reinforced with time and programming.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Void Functions Help
    By bethanne41 in forum C++ Programming
    Replies: 1
    Last Post: 05-09-2005, 05:30 PM
  2. Functions and Classes - What did I do wrong?
    By redmage in forum C++ Programming
    Replies: 5
    Last Post: 04-11-2005, 11:50 AM
  3. calling functions within functions
    By edd1986 in forum C Programming
    Replies: 3
    Last Post: 03-29-2005, 03:35 AM
  4. Factory Functions HOWTO
    By GuardianDevil in forum Windows Programming
    Replies: 1
    Last Post: 05-01-2004, 01:41 PM
  5. Shell functions on Win XP
    By geek@02 in forum Windows Programming
    Replies: 6
    Last Post: 04-19-2004, 05:39 AM