Archived

This topic is now archived and is closed to further replies.

C++ Books

This topic is 5336 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, I know the basics pretty well, the only problem i''m having with making programs that my friend pointed out to me is I don''t make any pseudo-code I just write out what I think should work and then test it out. The books I''ve been using to learn from are Introduction to Computer SCience with C++ by Kenneth A Lambert and Object Oriented Programming in C++ by Lafore. What should I be focusing on. I''ve got a sound handle on if-then statements, loops, i start stumbling on problems that use nested loops, and i''ve dabbled with recursion a tiny bit. I''ve got other books that seem a bit over my head at the moment. They are "Tricks of the Windows Game Proramming Guru''s", and Design pattern''s, and Effective C++. The latter I just got from my dad but haven''t had a chance to browse through yet.

Share this post


Link to post
Share on other sites
Nothing wrong with not writing out pseudocode, as long as you can express your design in C++. One thing to keep in mind is that you should spend a LOT of time writing your own programs. I''d say at least three hours programming for every hour reading.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
My reading is usually in chunks. When i'm not around a computer i spend my time reading when i'm around it i do programming.

Did a little exercise yesterday taht took close to 5 hours to get it working the way it should have.

supposed to display

*
***
*****
*******
*****
***
*

using nested loops.

[edited by - Lorek on May 7, 2003 12:04:16 AM]

Share this post


Link to post
Share on other sites
Participatory learning is much better for programming. Consider limiting your reading between chances to try stuff ouf, i.e., instead of reading a bunch and then programming a bunch, only read one section, over and over, until you can get to a computer.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
the thing i''ve been having the most trouble with is figuring out how to do string''s without using these stupid prebuilt includes which I dont have.
aka APstring.h

Share this post


Link to post
Share on other sites
So how would I go about setting up a string without a prebuilt library. My dad used to program and he said I should be using a Char* array

Share this post


Link to post
Share on other sites
also I'm supposed to make a program that will read characters from a file and print them omitting all e's. So this is what i have.

#include <iostream.h>
#include <fstream.h>
#include <assert.h>

void main()
{
char ch;
ifstream infile;
infile.open("new");
assert (!infile.fail());

while(!infile.fail())
{
infile.get(ch);
if((ch !='e') || (ch!='E'))
cout << ch;

}
infile.close();
}

The only problem with it is it displays the whole string including all the E's which doesn't make sense.

[edited by - Lorek on May 7, 2003 12:42:40 AM]

Share this post


Link to post
Share on other sites
if((ch !=''e'') || (ch!=''E''))

Go thru this in your head or on paper. Suppose ch == ''e''.
Then ch != ''E''.

if((ch !=''e'') && (ch!=''E''))

I think this is what you wanted - a common mistake.


Share this post


Link to post
Share on other sites