I'm making too many mistakes with C++ how do I sort this out

Page 1 of 1 [ 6 posts ] 

Stimshieme
Snowy Owl
Snowy Owl

User avatar

Joined: 15 Nov 2007
Gender: Female
Posts: 149

25 Apr 2008, 11:03 am

I have learned many computer languages but I'm finding C++ to be the hardest.

Any tips on how I can master it?



LoveableNerd
Deinonychus
Deinonychus

User avatar

Joined: 23 Apr 2008
Age: 50
Gender: Male
Posts: 380
Location: USA

25 Apr 2008, 11:12 am

What is it about c++ you are having difficulty with?


_________________
Reasonable people adapt themselves to the world. Unreasonable people attempt to adapt the world to themselves. All progress, therefore, depends on unreasonable people.---George Bernard Shaw

8th Cmdmt: Thou Shalt Not Steal.


megarat
Butterfly
Butterfly

User avatar

Joined: 2 Mar 2008
Age: 54
Gender: Male
Posts: 11
Location: Squirt Island, USA, Earth

25 Apr 2008, 1:58 pm

C++ is probably the deepest, most-complex high-level computer language available. If you want to master C++, just keep on working with it, over and over. Unlike many other lightweight languages like Perl/Python, even Java, you can't become an expert in C++ with only casual use.

(Note that I have nothing against Perl/Python/Java, as they're unparalleled for certain purposes, but any language with loose typing automatic garbage collection is lightweight.)

I don't know how far along you are, but some books you might find useful:

"The C++ Primer Plus" by Prata; a great starter text for beginners through intermediate C++ programmers

"Effective C++" (and to lesser degrees, "More Effective C++" and "Effective STL") by Meyers; an essential book for intermediate programmers and above; covers the important subtleties that aren't always mentioned but will bite you in the ass if you aren't aware of them.



tomadao
Raven
Raven

User avatar

Joined: 10 Mar 2008
Gender: Female
Posts: 115

25 Apr 2008, 2:14 pm

Maybe "The C++ Programming Language" by Stroustrup, would help.



ToadOfSteel
Veteran
Veteran

User avatar

Joined: 23 Sep 2007
Age: 36
Gender: Male
Posts: 6,157
Location: New Jersey

25 Apr 2008, 2:18 pm

Any particular problem you're having?



Stimshieme
Snowy Owl
Snowy Owl

User avatar

Joined: 15 Nov 2007
Gender: Female
Posts: 149

25 Apr 2008, 3:22 pm

I'm justing having trouble with the syntax and making the darn thing run. I tried to make a program work but unlike BASIC and Python I can't recognise and correct the syntax quick on C++ it proves difficult, when I have mistakes in the rest of the commands I think if there is something wrong with the syntax or the language I change ONE thing and the whole things crumbles. So today I tried to actually write the program on paper and copy it and I STILL get it wrong!]

Take for example this from Wikipedia:

I usually have trouble with the syntax, I keep on practicing to no avail.

Quote:
template <class Derived>
struct base
{
void interface()
{
// ...
static_cast<Derived*>(this)->implementation();
// ...
}
};

struct derived : base<derived>
{
void implementation();
};


(my program is way too long so thats why I used the example)

Isn't there and easy way to split the stuff into componants? And by using an external program to just bundle the whole program together?