Noob Help :)

This is a discussion on Noob Help :) within the C++ Programming forums, part of the General Programming Boards category; Hi, I am reading "Game Programming All in One". The first chapter starts out with him opening up VB 6 ...

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    3

    Noob Help :)

    Hi,

    I am reading "Game Programming All in One". The first chapter starts out with him opening up VB 6 and has your write a simple C++ program. He says you need to add a file to the project, a C++ source file, done. Then you type this up:

    Code:
    #include <iostream>
    main (void)
    {
    	std::cout << "Hello all you happy people" << std::endl;
    	return 0;
    }
    However, he does not show it written in VB, instead just typed on the page. So I am a bit confused. I am using Visual C++ 2010 express, and it gives the option to precompile headers, empty project, ect. Nothing seems to work.

    With the headers I get:
    Code:
    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    with nothing:
    Code:
    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>  stdafx.cpp
    1>  Generating Code...
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Please help :\

  2. #2
    The Dragon Reborn
    Join Date
    Nov 2009
    Location
    Dublin, Ireland
    Posts
    629
    i think you need to do "int main()" and return a value..

    do you want a code for C++ or VB?
    You ended that sentence with a preposition...Bastard!

  3. #3
    Registered User
    Join Date
    Feb 2011
    Posts
    3
    Oh sorry I meant to say he uses Visual C++ 6

    I'd love the code for C++

  4. #4
    The Dragon Reborn
    Join Date
    Nov 2009
    Location
    Dublin, Ireland
    Posts
    629
    However, he does not show it written in VB, instead just typed on the page.
    that :S me...

    btw just add an
    int before main()

    Code:
    #include <iostream>
    main (void)
    {
    	std::cout << "Hello all you happy people" << std::endl;
    	return 0;
    }
    from the code you posted you returned a value and specified no return type..try:

    Code:
    #include <iostream>
    int main (void)
    {
    	std::cout << "Hello all you happy people" << std::endl;
    	return 0;
    }
    You ended that sentence with a preposition...Bastard!

  5. #5
    Registered User
    Join Date
    Feb 2011
    Posts
    3
    Thank you so much! I can finally get past the first chapter. I will know now when he posts code like that I will edit that. Thanks!

  6. #6
    The Dragon Reborn
    Join Date
    Nov 2009
    Location
    Dublin, Ireland
    Posts
    629
    Quote Originally Posted by hcted View Post
    Thank you so much! I can finally get past the first chapter. I will know now when he posts code like that I will edit that. Thanks!
    why not just learn C++ or programming first? will make your life easier
    if it is a game programming book you're reading (and I believe I know which one)..trust me it is going to go advanced before you can blink 2 chapters..

    btw..no problem :P
    You ended that sentence with a preposition...Bastard!

  7. #7
    Registered User ~Kyo~'s Avatar
    Join Date
    Jun 2004
    Posts
    320
    If thats what is in the book they probably assumed ::shudder:: void main() or some such bad programming stuff. Burn the book; Use google.

  8. #8
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by hcted View Post
    Thank you so much! I can finally get past the first chapter. I will know now when he posts code like that I will edit that. Thanks!
    Alternatively; you could find a book or tutorial from someone who actually knows what he's talking about...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. noob calling value in func help
    By Sinamp in forum C++ Programming
    Replies: 5
    Last Post: 12-07-2010, 12:09 PM
  2. Noob in need of help.
    By gec5741 in forum C++ Programming
    Replies: 18
    Last Post: 01-23-2009, 02:25 PM
  3. I'm a noob and I need help.
    By nifear4 in forum C Programming
    Replies: 17
    Last Post: 10-14-2008, 01:20 PM
  4. noob here
    By lilhawk2892 in forum C++ Programming
    Replies: 2
    Last Post: 09-19-2005, 10:12 AM
  5. noob needs help!!!!:(
    By tykenfitz in forum C Programming
    Replies: 1
    Last Post: 07-10-2005, 08:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21