Thread: Advice for Beginner??

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    2

    Advice for Beginner??

    Hi. I have been programming with java for a coupla years and want to get into C++. I have looked around the web and read a little about C++ and would like to ask a few questions

    First off I did better learning java without an IDE(after trying one first -- i got pretty much the results I wanted but didnt really understand what was happening) - so I went to just using notepad to write my code and compiling it myself. I learned alot more and actually understood what was happening... so I think I would like to use a C++ compiler without an IDE.

    I have downloaded the Borland 5.5 compiler, GCC compiler and Dev-CPP(which i think is an IDE?). I also have MS Visual Studio6.0 Enterprise Edition(on the advice of some friends that said to use Visual basic and Visual C -- is VisualBasic even C++?) but was really confused by it. Any advice on which one to use?

    Also, is there one standard libray that all C++ compilers use or a different one for each compiler? Seems I have seen different ones while reading about C++ on the net. (if there is one standard library, where can I find the documentation?). If standard libraries are different, surely there is a C++ core library that is the same for all compilers??

    thanks for any info you can give...
    Last edited by hawghauler; 05-31-2003 at 06:15 AM.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >so I think I would like to use a C++ compiler without an IDE
    I recommend Boarland 5.5 or gcc then.

    >is VisualBasic even C++?
    The IDE is probably written in C++, but the language is a flavor of BASIC.

    >Any advice on which one to use?
    I like the debugger in Visual C++, but you'll be frustrated often if you try to use standard C++ with it. The compiler has hacks and kludges in the implementation of the standard library that are nothing short of idiotic. Borland 5.5 is more conforming to the standard.

    >is there one standard libray that all C++ compilers use or a different one for each compiler?
    Every compiler that claims to implement ISO C++ must include working versions of these headers. However, pretty much every compiler also supports extended libraries that are not portable to other compilers.
    My best code is written with the delete key.

  3. #3
    CS Author and Instructor
    Join Date
    Sep 2002
    Posts
    511
    That is one thing you will notice Java and C# have one standard library. C/C++ has what Prelude says.


    That is both good and bad!
    Mr. C: Author and Instructor

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    You will notice that even in the advanced Visual C++ 6.0 and Dev-C++ IDEs you'll spend most time in a syntax-highlighting code editor - not like NetBeans, VisualBasic or Borland C++ Builder where you just put controls on a form and write a little event handling code.

    Standard libraries:
    C++ has a standardized library, but only for basic operations. These include: string handling, console input/output, file operations (basic ones), data containers, algorithms and program localization. Nothing graphical, this is all up to platform-dependent APIs or special libraries developed to be cross-platform (GTK+, wxWindows, ...). Those are a bit like AWT, I don't know of any Swing-like library.
    Threads and that stuff are also platform-dependent, unless you get another cross-platform library like Boost.Threading.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    "First off I did better learning java without an IDE(after trying one first -- i got pretty much the results I wanted but didnt really understand what was happening) - so I went to just using notepad to write my code and compiling it myself."

    I used Visual C++ 6.0 as my compiler to learn C++. Programming wise, it's exactly the same as using notepad. You have to write every line of code yourself, and if you don't know what you're doing, it won't work. VC++ does provide some syntax hi-lighting and automatic indenting, but that makes it easier to catch errors in your code as you're typing. As your programs get bigger, it also provides nifty ways to navigate around your code, but you still have to write every line just like in notepad.

    As you get more experienced, VC++ has some nice debugging features that allow you to track down errors in your code. Until then, the only debugging feature you'll use is clicking on the error message to jump to the line where the error occured. The IDE, or Visual part of the compiler, where large portions of code are created for you, doesn't come into play unless you start doing Windows Programming with MFC.

    The most confusing thing about VC++ for beginners is learning how to choose the proper setup to create a program. Here is an explanation:

    The first thing you need to do before you start writing your program is to start a new project. You should close all workspaces before doing that by clicking on File/Close Workspace. Then click on File/New. The projects tab should be selected and you should make sure the radio button for "Create new workspace" is checked. For a console program(needed for beginning C++ programs), select Win32 Console Application, fill in a project name, then click OK. Then select Empty Project and click Finish. Then click on OK.

    Now you need to create a file for your project. Click on File/New and the Files tab should be selected. Click on C++ Source File. Make sure the "Add to project" check box is checked. Fill in the File Name(with no extension--it will be added for you) and click on OK. At the top left of the Visual C++ window, in the blue border, it will show the project name and then Microsoft Visual C++. The file you created has its name in the blue border at the top of its window.

    Then you type in your code, and when you are done you need to compile it. You can compile your program by clicking on the tool bar button that looks like a box with dots in it and two down arrows with dots above the arrows, or by choosing the build menu item and selecting "Compile your_project.cpp". Any errors will be displayed in a separate frame. You can read an error and then click on the error message to take you to the line where the error occured in your code. Once you take care of all the errors, then you can execute your program by clicking on the tool bar button that looks like a red exclamation mark, or by clicking on the Build menu and selecting "Execute your_project.exe". After that, a DOS window will open and the results of your program will be output to the DOS window. If none of the tool bar buttons mentioned are visible, simply right click on an empty spot in the tool bar area and select "Build MiniBar" and those buttons will appear. You can also drag the tool bars anywhere you want.

    The project hierarchy goes like this: workspace/project/files. A project is simply a program of some kind made up of various files(for a beginner it will be only one file), and a project workspace is a folder in which all the information relating to a project is stored. When you create a project, a project workspace(a folder) is created automatically, and Visual C++ will maintain all the source code and other files in the project workspace folder. When you want to stop working on a program, you click on File/Close Workspace, and when you want to start working on a previous project, you click on File/Open Workspace or File/Recent Workspaces.

    The only way you can permanently delete files and/or workspaces is to navigate to the folder on your computer and delete one of the files in the folder or the whole folder. Deleting a file in Visual C++ does not remove it from the workspace.
    Last edited by 7stud; 05-31-2003 at 04:59 PM.

  6. #6
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    A slight error: you got the notion of workspaces wrong.

    The directory a project resides in is simply the project directory. A workspace is a collection of related projects that make up a program. Usually that means the project for the main exe file + some project for DLLs that are also part of your application.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  7. #7
    Registered User
    Join Date
    May 2003
    Posts
    2
    Thanks for the input everybody. It's much appreciated and has really helped me out.

    I know my questions were really basic and not many people like to answer Q's like these -- I just needed to get a few things clear before getting any deeper... so thanks again

    btw 7stud, I think you are right on with this ----->
    The most confusing thing about VC++ for beginners is learning how to choose the proper setup to create a program
    Thanks for the explanation.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Advice on C Programming with MSVC++ 2008
    By IT_Guy in forum Windows Programming
    Replies: 1
    Last Post: 03-06-2009, 04:23 AM
  2. game engine advice?
    By stien in forum Game Programming
    Replies: 0
    Last Post: 01-23-2007, 03:46 PM
  3. Resume advice
    By Zughiaq in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 04-15-2005, 02:16 PM
  4. girl friend advice (prob. the wrong place)
    By B0bDole in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 10-22-2004, 06:38 PM
  5. Partitioning advice?
    By mart_man00 in forum Tech Board
    Replies: 6
    Last Post: 01-10-2003, 10:53 PM