Thread: C++ basic

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    4

    Unhappy C++ basic

    hi
    is C++ a program that i need to download? or the programming language that appear in the tutorials can be typed in NotePad for instance?
    a basic question but i really know nothing about programming and i want to do things right
    thanks

  2. #2
    semi-colon generator ChaosEngine's Avatar
    Join Date
    Sep 2005
    Location
    Chch, NZ
    Posts
    597
    C++ is a programming language. You can type the source code in notepad, wordpad or a specialised code editor. Hell, you could type the code into word (as longer as you saved it as text file).

    Once you've typed in the code, you need a piece of software called a compiler, which translates the code into something your computer can understand (there's also a second step called linking, but for simple programs that's not so important). There are several different C++ compilers out there. Which one you use depends on your platform and how much you want to pay. If you're running on windows, you can't really go past the free version of visual c++ (see my sig).
    "I saw a sign that said 'Drink Canada Dry', so I started"
    -- Brendan Behan

    Free Compiler: Visual C++ 2005 Express
    If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Besides Microsoft Visual C++, I like Dev-C++, and many people recommend Code::Blocks. (Those are all free.)

    The programs I mentioned are all Integrated Development Environments, which means that they are editors and compilers (and much more besides) rolled into one. They also highlight code to make it easier to read (which is important to me -- see codeform ).
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #4
    Registered User
    Join Date
    Apr 2007
    Posts
    4
    geat info thanks!

  5. #5
    Registered User
    Join Date
    Apr 2007
    Posts
    4
    DWK, your website needs someway to contact you i think, i tried to run the 3dm game but didnt work, prompted error

  6. #6
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    Just in case it's not quite clear... You will save your human-readable source code in a .CPP file. The compiler/linker will take your .CPP file and it will create a .EXE file that you can run on your computer.

    It can take awhile to get a compiler/IDE downloaded, configured, and working. So, be prepaired to spend a few hours getting started.... And don't get discouraged if it doesn't seem to work on the first try. I've used several different compilers, and there always seems to be a snag. I'm usually happy if I can get Hello World running in half a day! (And, you should always try-out "Hello World" whenever you get a new compiler.)

    Once you get your compiler/IDE figured-out, things will get better, and you'll have more fun as you learn about branching (using if-statements to make decisions) and looping (doing things over & over). Looping and branching are the two things that make programming worthwhile!

    Assuming that you are running Windows, you should be aware that Windows will close your program window as soon as your program is finished running. If you are running windows, you will need to use a "trick" to keep the window open so that you can see the results of your program. (The standard "Hello World" program won't seem to work correctly on a Windows system. You need to make the program pause, so you can see what you've displayed on the screen.) Click here and here.

  7. #7
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Assuming that you are running Windows, you should be aware that Windows will close your program window as soon as your program is finished running.
    Only if you're using Dev-C++ or Borland C++ Builder. Code::Blocks and Visual C++ keep the console open.
    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

  8. #8
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    VC++ only does it in "execute" mode. When running through the debugger (which you should do most of the time when developing) it doesn't.

  9. #9
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    When you run it through a debugger, just put a breakpoint on the last line of main().

    But usually you'll want to stop even earlier anyway.
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. [ANN] New script engine (Basic sintax)
    By MKTMK in forum C++ Programming
    Replies: 1
    Last Post: 11-01-2005, 10:28 AM
  2. what are your thoughts on visual basic?
    By orion- in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 09-22-2005, 04:28 AM
  3. visual basic vs C or C++
    By FOOTOO in forum Windows Programming
    Replies: 5
    Last Post: 02-06-2005, 08:41 PM
  4. Basic Graphics programming in C, please help
    By AdRock in forum Game Programming
    Replies: 3
    Last Post: 03-24-2004, 11:38 PM