Well, I started teaching myself C++

Sharky Forums


Results 1 to 11 of 11

Thread: Well, I started teaching myself C++

  1. #1
    I don't roll on Shabbos! Timman_24's Avatar
    Join Date
    Aug 2004
    Location
    Urbana, IL
    Posts
    12,648

    Well, I started teaching myself C++

    Its going pretty well. I got a book last night and already wrote two very basic programs. It is pretty fun actually. I'm using Dev-C++ right now, would be nice to have Visual Basic, but I dont have 300 bucks to throw away haha.

    Anyone have some basic programing projects that I can try? Such as taking the average of a certain amount of numbers, etc?

    Anyone else teach themselves C++, if so about how long did it take to get proficient in the language?

    Thanks!
    PC: Corsair 550D
    4280k | Asus Rampage Gene | Mushkin 4x4GB | EVGA 780
    Intel 120GB SSD + 2TB Seagate | Seasonic 660 Plat
    2x Alphacool XT45 | Laing DDC | Bitspower

    Currently playing: Civ 5
    Last Game Beaten: Walking Dead

  2. #2
    Hammerhead Shark
    Join Date
    Feb 2001
    Posts
    1,612
    Write a program that outputs, in words, what a declaration means.

    e.g.

    int **(*func)()[7]

    func: pointer to function() returning array[7] of pointer to pointer to int.

    I think that's right. Kind of rusty on my order of operations.

    Not necessarily basic, but this was the exercise from K&R that was the most help in my understanding of pointers.

    Don't be afraid to write something that is actually useful every now and then, either.

  3. #3
    I don't roll on Shabbos! Timman_24's Avatar
    Join Date
    Aug 2004
    Location
    Urbana, IL
    Posts
    12,648
    I'll give that a try tomorrow. So far I've written one that takes the derivative of a polynomial, one that averages three numbers together, and one that converts celsius to fahrenheit.

    Mostly math based, I havent gotten deep into logical operators yet. I'll work on some of that tomorrow.
    PC: Corsair 550D
    4280k | Asus Rampage Gene | Mushkin 4x4GB | EVGA 780
    Intel 120GB SSD + 2TB Seagate | Seasonic 660 Plat
    2x Alphacool XT45 | Laing DDC | Bitspower

    Currently playing: Civ 5
    Last Game Beaten: Walking Dead

  4. #4
    Hammerhead Shark
    Join Date
    Jun 2003
    Posts
    1,019
    my basic c++ book came with a simple graphics library which allowed to draw points, lines, circles, and text in a window it also had mouse click detection

    its very easy to learn all the functions making it good for beginner projects

    the book was called big c++ and im pretty sure their site has the libraries for download

  5. #5
    NullPointerException rock's Avatar
    Join Date
    Sep 2000
    Location
    York, PA
    Posts
    6,203
    Look into the Visual Studio Express editions if you want to move to a 'real' IDE

    As for projects in an OO world, start putting together a class library of helper functions that you'll use repeatedly. For example, a FileIO class with methods that lets you easily open a text file and read/write a column of numbers. Anything you write twice should go into a (well-documented) library.

    Open Source is free like a puppy is free.

    It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames.

    Understanding Evolution

  6. #6
    Mako Shark Mancora's Avatar
    Join Date
    Jun 2001
    Location
    The other side of where the fishes swim
    Posts
    4,313
    One suggestion would be to head over to your library and pick up C++ book, and work through it. It can be a bit dry but its not a bad way to make sure you end up with a firm understanding of the basic control structures, classes, methods and structures (probably some other stuff i'm forgetting).

    Once you get that stuff down you can go in any direction you want to and pick up stuff as needed IMHO.

    If you head off to bigger stuff before getting the basics down I suspect you'll be pushing yourself into frustrating corners.

  7. #7
    Ultra Great White Shark!! richardginn's Avatar
    Join Date
    Feb 2001
    Posts
    16,118
    Quote Originally Posted by Mancora
    If you head off to bigger stuff before getting the basics down I suspect you'll be pushing yourself into frustrating corners.

    I fully agree.
    www.myeducational plan.com-come see my plan to fix the USA educational system. I hope this is sig legal. Major Site Design Update on July 18, 2006. On June 18, 2009 passed the 10,000 post mark. December 24, 2009: Major Theme change and more....

  8. #8
    Has got that jut monroeski's Avatar
    Join Date
    Nov 2002
    Posts
    8,055
    Quote Originally Posted by Mancora
    One suggestion would be to head over to your library and pick up C++ book, and work through it.
    Of course, he mentioned in the first post that he already GOT a book...
    Comp - i7 950, Radeon HD 5870, 6gb DDR3 1600
    Currently Playing - Gravity Rush 2, DOOM (2017), Nex Machina
    Currently Reading - Dracula by Bram Stoker

  9. #9
    Tiger Shark
    Join Date
    Jun 2001
    Posts
    860
    Quote Originally Posted by rock
    Anything you write twice should go into a (well-documented) library.
    I sorta disagree. I think when you're just starting out programming, it's important to experiment with different ways of implementing similar functionality, so you can get a feel of how some solutions are more elegant (efficient, simple) than others in different situations.

  10. #10
    Hammerhead Shark benneke's Avatar
    Join Date
    Aug 2001
    Location
    antwerp
    Posts
    1,531
    i must disagree with the choice for visual studio as good IDE for creating C/C++ programs. The builtin compiler isnt a very goodone. The compiler in DEVC++ (gcc compiler) is alot better, especialy when using templates and the STL

    We program alot of algorithms (including self implement datastructures) and we have noticed that, if we compile the same program on vs and on gcc, the result binairy program that was created by gcc is faster then the one on vs

  11. #11
    Hammerhead Shark
    Join Date
    Feb 2001
    Posts
    1,612
    I like VS just because it's easier to make Windows apps, more penetration, easier to find help, etc. But yeah, if you're coding for speed, by all means try everything out there and use whatever is fastest.

    For "teaching yourself C++", I don't know if I'd really recommend using anything open-source unless you're on linix.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •