Archived

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

Elliott AGP

HeLP!!!

Recommended Posts

I have recently began to learn C++, using my windows ME machine with 128 megs of ram and an 800MHZ processor using blooshedd C++ as a compiler and code editor. I have been looking for decent books online as I can not afford to go out and buy any at this point in time, and I have been working on learn c++ in 21 days (been on day 3 for two weeks)I still dont understand variables, how they work is easy enough, but with todays ram does using any ones other than long or double really have a huge impact. If any one can help describe their actuall use and such I would be happy. Also when I use double x; cin >> x; how do I get the damn thing to recognize acsii input versus numerics. This is an idiot post but I need human interaction the fucking thing is driving me mental. Thanks in advance... No one can run without taking a first step.

Share this post


Link to post
Share on other sites
''double'' and ''float'' are numeric variables. They can only store numbers. If you want to get ASCII input, you need to use a character string, like so:
  
char* buffer = new char[128];
cin >> buffer;


~~~~~~~~~~
Martee

Share this post


Link to post
Share on other sites
Okay, thanks,

what the hell does it mean though. I hate having you take the time and show me when the basics need to be instilled first. A majority of you peopel are self taught from what I hear and it may be nice to hear exaclty where you got all your knowledge!!!!

Thanks anyways, I am gong to mess with it and see if I can figure it out, but still reply everybody! lol

Elliott

No one can run without taking a first step.

Share this post


Link to post
Share on other sites
I think Martee''s post above was a little above where you seem to be, so it can be simplified down a bit.

float and double both hold decimal point numbers (with double being able to hold a larger number).

int and long hold integers (ie. Numbers without decimal points).

char holds a single character. If you want to hold a string of text, you need to declare an array of characters. But, you probably haven''t done arrays yet in 21 days, so for now just be satisfied with a char variable being only able to hold one ASCII character. (btw, the array part in Martee''s post was the ''[128]'' bit).

anyway, I hope that helps. Just stick at it and you''ll get it sooner or later.

MelvinElvin.

Share this post


Link to post
Share on other sites
Thanks! That cleared it up a bit. Anyone have any recomended reading material? I am glad that I understant that now!

No one can run without taking a first step.

Share this post


Link to post
Share on other sites
"C For Dummies" Volume one and two. And they are actually books, good ones, im not calling you a dummy... i own them

Share this post


Link to post
Share on other sites
C++ is just an extension to C. So, if your book assumes previous knowledge of C (it usually says so somewhere in the introduction or something like "Who is this book for") then you should learn C first. If your book teaches C++ from scratch, then you don''t need to learn C first. I myself started with C and then learned C++. But you should be careful about this since C++ requires a whole different way of thinking.

Share this post


Link to post
Share on other sites