Skip to main content
GameDev.net gamedev.net
🔒 Locked

HeLP!!!

Started by Elliott AGP Jun 22, 2001 at 9:11 PM 6 replies 400+ views
Original Post
Elliott AGP
Elliott AGP
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.
No one can run without taking a first step.
Martee
Martee
''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
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
Elliott AGP
Elliott AGP
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.
No one can run without taking a first step.
MelvinElvin
MelvinElvin
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.
GSACP: GameDev Society Against Crap PostingTo join: Put these lines in your signature and don't post crap!
Elliott AGP
Elliott AGP
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.
No one can run without taking a first step.
Spiral
Spiral
"C For Dummies" Volume one and two. And they are actually books, good ones, im not calling you a dummy... i own them
--------------------Go Stick Your Head In A Pig
Elliott AGP
Elliott AGP
iS IT GOOD FOR learning C++ or just c, which should i learn first?
No one can run without taking a first step.
Midnight Coder
Midnight Coder
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.