Thread: What is C++ used for?

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    22

    What is C++ used for?

    Hey everyone,

    I am extremely interested in all computer programming languages, and have a pretty extensive knowledge in HTML and PHP. I'm considering getting involved with C++ or C, but first I'd like to know what it is generally used for. Let's say I wanted to make a program that automatically clicks on a link on a website. Could C++ be used for this?

    Oh, and please give me some project ideas which would help me learn C++ quickly.

    Thanks,
    CougarElite

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    The easier question is "What isn't C++ used for"
    Even better "Which language is better for task XYZ"

    There is pretty much nothing that can't be done in C++ but its not always the best tool for the job.

  3. #3
    Registered User
    Join Date
    Apr 2004
    Posts
    22
    I see... C++ can be used to make programs that actually open and have buttons and stuff right? I got into C a little while ago and all I ended up making was console stuff.

  4. #4
    yes, I'm registered!!! algi's Avatar
    Join Date
    Nov 2004
    Location
    Ipswich
    Posts
    161
    C++ is good for nearly everything, console, windows all types of programmes can be done in C++

  5. #5
    Registered User
    Join Date
    Apr 2004
    Posts
    22
    Sweet. Can you give me any tips on getting started? Any online tutorials and/or book recommendations?

  6. #6
    yes, I'm registered!!! algi's Avatar
    Join Date
    Nov 2004
    Location
    Ipswich
    Posts
    161
    the first thing I did was get a compiler. You can get one for free, just type in google dev c++ download, and it will come up with the dev c++ compiler downloads, which are free

    Then I started learning tutorials from this website before moving onto Sams Teach yourself C++ in 21 days

  7. #7
    C/C++ homeyg's Avatar
    Join Date
    Nov 2004
    Location
    Louisiana, USA
    Posts
    209
    The Sams C++ in 24 hours is a good one two, however I don't recommend the book in my avatar (unless you buy it in combination with the Sams book).

  8. #8
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    C++ is a very powerful all purpose language. But beware. A Humvee is a very powerful all purpose vehicle, but I wouldn't want to go shopping, go out with my girlfriend or even pay it's gas price.

    If you are looking for something to easily build a nice user interface with buttons and graphics, try another language. Maybe Java or C#. C++ can do it. With fine control. There is very little you cannot do with it. But it takes skill and practice for even the smallest steps and you won't pull something up as easily as in other languages.

    When you start C++ you will most likely write console applications for a long time. Real Windows applications are relativly complicated.

    If you want to invest the time to learn C++, it can be very rewarding. But for each job there is a good tool and sometimes an easier tool gets the job done better.

    It's you decision, just like manual or automatic transmission. While I think automatic is for disabled people, it sure gets you to the supermarket and back. And if all you need is getting some groceries, there is no need to learn manual.

    Summary: good tools are hard to master. C++ is a great tool. Your decision
    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.

  9. #9
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Cool C++ Is Everywhere!

    What is C++ used for?
    There is a good chance that the little brain inside your DVD player is running a C or C++ program.

    Windows, MS Word, and Excel, and Linux are all written in C/C++ (with sprinkles of assembly and maybe bits of other languages.)

    ...that automatically clicks on a link on a website. ...to make programs that actually open and have buttons and stuff.
    For this, you have to go beyond standard C++. Standard C++ is designed to be portable... to run on "anything". There is no mouse, graphics, color, or sound in standard C++. Windows compilers include the Windows API Library, which is an extension of standard C++.

    You do need to learn standard (console) C++ first. And, it's not just a matter of a few CreateWindow() functions... "Hello Windows" is about 2-pages of code! Here's a link to a Windows Tutorial. Just about every Windows Programmer owns a copy of Programming Windows, by Charles Petzold.

  10. #10
    Registered User
    Join Date
    Apr 2004
    Posts
    22
    Ugh... I'm lost. I don't know where to start. It's hard to decide because I don't really have a goal that I want to reach. Think I should just buy a book on C++?

  11. #11
    Registered User
    Join Date
    Nov 2004
    Location
    Pennsylvania
    Posts
    434

    Thumbs up

    First off let me answer your book question: I would, i got the Sams teach yourself in 21 days, it was good but i stopped like 1/3 into it and just picked up on things i found useful, it got a little confusing (but im just a kid) but i got me started. You can also get a DEV C++ Compiler ( i use it) it's free and actually not too bad. I started learning C++ on this site though in the tutorials section and if you ever have a question the boards are the most valuable resource.

    By the way, just a fact: I think one of the CounterStrike games for the PC was written with some C++

    Good Luck!

  12. #12
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    I don't know where to start.
    1. Compiler
    2. Tutorials
    3. Books


    Check out Getting Started here at cprogramming.com.

    There is a list of free compilers atTheFreeCountry.com. Or you can buy one. You can get Microsoft Visual C++ for about $100. Don't get discouraged if it takes you half a day or so to to get a compiler installed, configured, and working. I've used a handful of different compilers, and they've always been a pain to set-up and learn to use.

    You can start-out with the cprogramming.com tutorials , or another tutorial. But, you'll probably need some books if you decide to "stick with it". There's a lot more to C++ than what's covered in most tutorials. For example Teach Yourself C++ in 21 Days, by Jesse Liberty is about 750 pages. Accelerated C++, by Koenig & Moo, is about 350 pages. And, these are just beginning books.

    I started-out with the "21 Days" book. I liked it because it is easy to understand, and well-structured for self-study with questions & exercises at the end of each "day" (chapter), and answers & solutions in the back. But, I always include a WARNING - Some people hate all of the "21 Days" books.

    I don't own Accelerated C++, but it's frequently recommended, and I haven't read anything negative aboiut it.

  13. #13
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    don't get a "teach yourself" or "for dummies" book.......go to your local community college and buy a used c++ textbook...my college uses deitel and deitel and i used to find it fairly helpful (until i learned everything in it)...

    it does only teach you console programs however...but that is something you must learn before GUI programming...console programming doesn't sound all that interesting, but it makes it gives you all the basic knowledge you need for GUI programming...after you know how to make console programs, GUI programming is just a bunch of API calls...but you will never be able to effectivly learn them without, oh, say, knowing how to use pointers...and you'll never learn how to use pointers when your overwhelmed with API routines...however, pointers are relatively easy to learn in console....

    but to answer your question c/c++ is and can be used for 'almost' anything...i might even go as far as to say that c/c++ is the most powerful language around with the exception of asm...but c/c++ is MUCH easier to code in than asm and is much more portable, so it is more widely used..

    i'm not sure exactly what you mean by "automatically clicks on a link on a website", but i'm sure the answer is yes...but i'm sure a much better alternative to yourquestion would javascript.


    ..wow..don't give me anymore beer
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  14. #14
    Registered User
    Join Date
    Apr 2004
    Posts
    22
    Quote Originally Posted by misplaced
    ..wow..don't give me anymore beer
    LOL thanks for the help everyone. I'm going to go ahead and read the tutorial here on cprogramming.com after I get a compiler set up. If I come across any questions, I'll post them here.

    Thanks again.

  15. #15
    Registered User
    Join Date
    Jun 2003
    Posts
    91
    Its probably the trickiest language to learn, apart from Assembler.

    It's just code that you use to flip switches on and off. As for its applicability, well you can do it all in C++ - Drivers, GUI, web, desktop apps - and its more powerful and faster than any of the other languages, the drawback being that it takes a long time to master.

    You usually start off with getting a compiler / IDE package. Then you learn about the basics,

    Variables
    Functions
    Loops
    Indentation
    Headers etc..

Popular pages Recent additions subscribe to a feed