Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: C++ forums?

  1. #11
    Webius Designerous Indiginous
    Join Date
    Mar 2002
    Location
    South Florida
    Posts
    1,123
    I call int main() and return 0 just for good measure. Its always good to make sure that you return the values to 0 after the program.

    But as was said ihsir; that will work also, but if you begin to build more complicated programs, you may run into errors w/o the return 0 and int main() use.


    And as far as the DJGPP goes. I got rid of it. It couldn't find iostream.h file for some reason, even though i have all my paths set correctly. Now I'm using borland 5.5 and its much better and easier.

  2. #12
    Senior Member cwk9's Avatar
    Join Date
    Feb 2002
    Posts
    1,207
    Hello world in 2 lines

    #include <iostream.h>
    void main() { cout<<"Hello World"; }
    Its not software piracy. I’m just making multiple off site backups.

  3. #13
    Junior Member
    Join Date
    Nov 2001
    Posts
    14

    C++ help

    Thanks for all the help,this book did not seem right.With your help it works now.

  4. #14
    AO Antique pwaring's Avatar
    Join Date
    Aug 2001
    Posts
    1,409
    void main() is now outdated and shouldn't really be used, either in C or C++ programs. Most compilers won't complain, so long as you don't try and return a value, but it's good style to include the int delclaration. Also, gcc (the compiler for *nix) doesn't like void main() and will sometimes refuse to compile your program if it includes this line.
    Paul Waring - Web site design and development.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •