Thread: The n00best question of them all...

  1. #1
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438

    The n00best question of them all...

    I just got a student version of VS.NET and I was trying to do a simple hello world in cpp. Just to get the structure you save your files and such in. Any help? Do I create a new project or just a new file or what?

  2. #2
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    You'll want a win32 console project.

  3. #3
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438
    K, what after that?

  4. #4
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Open the IDE
    Select File->New->Project...
    Select C++ Projects on the left
    Select Win32 Application on the right side
    Enter name
    Click OK

    Select Applications Settings on the left
    Select Console Application on the right
    Click Finish

    Doubleclick on yourprojectname.cpp in the solution-explorer tree on the right to open your codefile.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  5. #5
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438
    Cool, thanks! So what is some simple code for a screen display I can do for a quick test? I'm so ready to start C/C++ but I feel like I'll get confused between it and Java. Should I wait, or should I start reading my book a little?

  6. #6
    Registered User BigSter's Avatar
    Join Date
    Nov 2001
    Posts
    47
    You could go:

    #include <iostream.h>
    #include <stdlib.h>

    int main()
    {
    cout<<"Hello World!"<<endl; //Prints Hello World on Screen
    system("PAUSE"); //Produces the "Press any
    // Key to Continue"
    }


    Check out this:
    http://www.cprogramming.com/tutorial.html

    Hope that helps.

  7. #7
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438
    That's pretty cool, thanks! So the header file is kind of like inheritance in Java? You can use methods, variables and such in the cpp file if they've been delcared in the header file?

  8. #8
    Registered User minime6696's Avatar
    Join Date
    Aug 2001
    Posts
    267

    Exclamation yeah sorta...

    A header file is simply a file that can be 'pasted into' you'ew program... werever you use '#include' you are telling the compiler to place whatever code is in that header into you're source, the reason it has earned the name 'header' is that in C/C++ you can have multiple source(s) as well have many, many, types of imported librareis, and to tell the compiler a function exists (the linker knows this from the import libz, but the compiler does not) you do something called a function prototype (vocab correct?). Most headers just include lists of these 'function prototypes' (again, vocab correct?) and declairation of symbols needed (#define) and all the other things that library needs to have in you're source for you to make use of it.

    I hope this helps, SPH

    P.S. Email: [email protected] , AIM: aGaBoOgAmOnGeR

  9. #9
    Registered User
    Join Date
    Feb 2002
    Posts
    1
    Open the IDE
    Select File->New->Project...
    Select C++ Projects on the left
    Select Win32 Application on the right side
    Enter name
    Click OK

    Select Applications Settings on the left
    Select Console Application on the right
    Click Finish

    Doubleclick on yourprojectname.cpp in the solution-explorer tree on the right to open your codefile.

    Windows is very userfriendly, lots and lots of buttons to press.

  10. #10
    "The Oldest Member Here" Xterria's Avatar
    Join Date
    Sep 2001
    Location
    Buffalo, NY
    Posts
    1,039
    just click new->file->C++ source file
    type your code and build
    and your done...it'll automatically create a project for you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  2. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  3. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  4. Question about linked lists.
    By cheeisme123 in forum C++ Programming
    Replies: 6
    Last Post: 02-25-2003, 01:36 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM