Thread: C++ beginner

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    1

    C++ beginner

    Hello
    I just statred to learn C/C++ and I am using MS Visual compiler.

    The problem i am haveing is that i do not fully understand how to save/ start my programs in a file.

    i understand how to use
    #include<stdio.h>
    void main (void)

    as my book tells me to start the program, but I dont know how /were i am saving the programs to.

    Please help me to understand (directories) i think.

  2. #2
    First off: Its 'int main(void)' not 'void main(void)'. Main should always return a value.

    Anyhow, to create a new project go to File->New. A window will pop up with a few different options of what type of project you want to create. It sounds like you would most likely want 'Win32 Console Application' which is I believe third from the bottom. You will also have to enter a name for your project (in the text bar to the right) and the location on your Hard Drive you wish to save it to. I would create a directory specifically for my applications, such as 'C:\MyApps'. Once you're done click OKAY and it should ask you if you want your application to be empty, or some other crap. Select empty (what a stupid option).

    Bingo. Project is made. Now you will either have to add a new file that you've made before or you can create a new one. Chances are you'll want a new file so select File->New again and select 'C++ Source File' or 'C++ Header File' from the list depending on what you want.

    Ready to go. Use File->Save and File->Save Workspace to save your project and your file. Use File->Load Workspace to open it back up again later. Visual C will automatically open your most recent project when you run it the next time tho.

    Hopefully that helped.
    "There's always another way"
    -lightatdawn (lightatdawn.cprogramming.com)

  3. #3
    Unregistered
    Guest
    When you create the workspace, pay attention to where it is created. Then when you hit save, the .cpp file & .h files will be saved into that directory. For instance, if you go to File>New, then click to the second ( Projects ) tab, then choose Win32 Console Application, then choose a project name ( edit box top right corner ), then choose Location ( edit box below project name ), this will be the location that all files for this program will be saved. Each new program will require a new project workspace. Good luck.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Same old beginner question...
    By Sharmz in forum C Programming
    Replies: 15
    Last Post: 08-04-2008, 11:48 AM
  2. What are some good beginner programs I shouold make?
    By oobootsy1 in forum C# Programming
    Replies: 6
    Last Post: 08-09-2005, 02:02 PM
  3. Best Free Beginner Online Books/Tutorials?
    By Zeusbwr in forum C++ Programming
    Replies: 2
    Last Post: 10-12-2004, 05:52 PM
  4. Windows programming for beginner (Absolute beginner)
    By WDT in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2004, 11:21 AM