Thread: C++ beginner Question

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    8

    C++ beginner Question

    Helo,

    I've had some java before where i used eclipse as a compiler.now im learning some c++ using codeblocks.

    Just a quick question:

    * in java i was used to make 1 projectfile then a could have as many source files i wanted in that project.Like when im going through examples in a book i just simply made new source code for that example.I didnt need to make a new project for every example in the book.

    *But as i se it in c++ i have to make a new project everytime or put the new example codes in a class and then call the from the class?

    Have i understood this correct?

  2. #2
    Registered User
    Join Date
    Aug 2010
    Location
    Poland
    Posts
    733
    You don't need any projects, but compiling from command line is annoying for a beginner. In code blocks, you must have a project to compile something.

  3. #3
    Registered User
    Join Date
    Mar 2011
    Posts
    19
    Quote Originally Posted by zyberb View Post
    Helo,

    I've had some java before where i used eclipse as a compiler.now im learning some c++ using codeblocks.

    Just a quick question:

    * in java i was used to make 1 projectfile then a could have as many source files i wanted in that project.Like when im going through examples in a book i just simply made new source code for that example.I didnt need to make a new project for every example in the book.

    *But as i se it in c++ i have to make a new project everytime or put the new example codes in a class and then call the from the class?

    Have i understood this correct?
    I think i works the same way as in java. You can add a new class to the project or make a new class in the same file you were just working on. You dont need to make a new project for every new code you are making.

  4. #4
    Registered User
    Join Date
    May 2010
    Posts
    120
    If you want to try out and compile a new source file without creating a new project you can just create the new file, remove the old file from the project and then adding the new file to the project. This way the old file will not be linked and you can get it anytime you want.

  5. #5
    Registered User
    Join Date
    May 2010
    Posts
    8
    Thank you all

    i found out it,just needed to switch my mind over to c++ and get used to Code Blocks Compiler.
    Now for trying out and compiling small codes i just new File->C++ Source-->next-->next->and just choose my workspace as path.

    At first a was making new projects all the time

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner: Linked List question
    By WeatherMan in forum C++ Programming
    Replies: 2
    Last Post: 04-03-2008, 07:16 AM
  2. Quick IF statement question (beginner)
    By jim.rattlehead in forum C Programming
    Replies: 23
    Last Post: 11-29-2007, 06:51 AM
  3. beginner question
    By Barrot in forum C++ Programming
    Replies: 4
    Last Post: 08-19-2005, 02:17 PM
  4. Question About External Files (Beginner)
    By jamez05 in forum C Programming
    Replies: 0
    Last Post: 08-11-2005, 07:05 AM
  5. Beginner on Win32 apps, lame question.
    By Templario in forum C Programming
    Replies: 3
    Last Post: 11-06-2002, 08:39 PM

Tags for this Thread