Need a good C++ book
I'm looking for a C++ book with exercices(solved),practice or something like "tips and trips of c++ language" cause I need to prepare for the exam.
If someone know's a kind of this book , pls reply.I searched google , but didnt found what i want
Eko
Junior Poster in Training
60 posts since Nov 2006
Reputation Points: 12
Solved Threads: 1
I am not very sure what you need there. Are you in need of some C++ tips and tricks, or a good book which you can buy from Amazon?
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
I need a book with tests, like : "Find the error in the code bellow",something like that . The c++ exam,i'll have to take, consists of trick questions , this is an example :
What's the error? .Describe it :
#include <iostream.h>
class B
{ int a;
B(int i=0) { a=i; }
int get_a(){ return a; } };
class D: protected B
{ public: D(int x=0): B(x) {}
int get_a() { return B::get_a(); } };
int main()
{ D d(-89);
cout<<d.get_a();
return 0;
I understood C++ pretty well , but our teacher makes some really really confusing exercices.That's why I need a book with this kind of exercices or a book about pitfalls in c++
Eko
Junior Poster in Training
60 posts since Nov 2006
Reputation Points: 12
Solved Threads: 1
I don't think anyone is dumb enough to write a book like that. Your best bet is simply to know the language well enough to figure out the problems. Or tell your teacher to learn the language well enough not to accidentally introduce errors so that the problems are easier. ;)
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
.I understood C++ pretty well ,.
I hope you are smart enough to realize the coding style of the code you posted is just awful. Here are some tips, although they should not be read as if they are written in stone. Pay attention to the indention, placement of braces and hints about spelling. Making your code more readable should be your next goal before doing anything else.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
I hope you are smart enough to realize the coding style of the code you posted is just awful. Here are some tips, although they should not be read as if they are written in stone. Pay attention to the indention, placement of braces and hints about spelling. Making your code more readable should be your next goal before doing anything else.
Considering that it's an example of a tricked up exam problem, why assume otherwise?
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
Tricked up exam problems tend to look legitimate, not like entries to the IOCCC. It's safer to assume that the teacher who wrote that is an incompetent fool.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
My teacher wrote that sample code , and yes,is bad formatted,but he's not so bad ; at class , he explaines very well and he's one of the few teachers who really knows about modern programming
I don't think anyone is dumb enough to write a book like that.
Well, I found someone who is : Yashavant P.Kanetkar
I have his book with Test your C skills(which is great), but i dont have the one with C++. I would buy it from amazon , but the shipment takes between 4-6 weeks :( , and the exam is in a few days.
Eko
Junior Poster in Training
60 posts since Nov 2006
Reputation Points: 12
Solved Threads: 1
How about googling around. There are websites (maybe) that could give you such awful problems for you to practice. *chuckles*
jaepi
Practically a Master Poster
647 posts since Jul 2006
Reputation Points: 32
Solved Threads: 4
>he's one of the few teachers who really knows about modern programming
So why does he insist on using pre-standard C++? I mean, he's had over ten years to get with the program.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401