Advertisement

Just started learning C++, please help!

Started by July 12, 2002 01:18 PM
13 comments, last by Manny Calavera 22 years, 5 months ago
[If you knew it wasn't a nice thing to say why did you say it in the first place]

[edited by - michalson on July 13, 2002 1:38:29 PM]
quote: Original post by Pipo DeClown
why don't you read before asking?

sorry for the cruelty...


First, he's 12 and seems like he's super new to programming in general

Second, this is the For Beginners forum and there have been tons of threads explaining why, if you feel like posting a response like yours in this forum, you shouldn't. there's little to no tolerance here for agro/condescending posts in this forum. if you don't like dealing with newb questions just don't read anything here.

Manny, please ignore this person's response.

-me

[edited by - Palidine on July 12, 2002 4:22:51 PM]
Advertisement
me sa 13,
I think that in the beginning I did this too,
but I just started reading and everything got fine...

listen to this person's advice


[edit]
boolean is a variable that can have two values,
a value like 1(true) or
a nonvalue 0(false).
negative numbers are true.

you declare booleans like this:
bool this_one_is_true = true;
bool this_one_is_false = false;
[/edit]
[edit2]
logic: do you know what that means?
most logic, have IFs.
""""so IF you are 12, THEN you're 12, ELSE you're something else."""
code:
if(your_age_variable == 12){ //== means equal to
your_age_variable == 12;}
else{ //else is part of the IF, if your_age_variable is other then 12
your_age_variable == .somethingelse.}

this is a code you never use, maybe to check if something really == something.

well, this is logical coding, the simple way.
readup on operators to learn other then "==".
[edit2]


[edited by - pipo declown on July 12, 2002 4:35:54 PM]
that book sucks, plain and simple. Get Accelerated C++.

Ok as you know by now, boolean variables hold either the value "true" or "false". You see there are different types in programming languages. You have int for integers, char for characters, and bool for booleans. We can add and subtract and do a bunch of other stuff with ints. Since bools aren''t numbers they have their own set of things they can do. They have "and", and "or" and "not".

The simplest to explain is not. If you use not on true it becomes false, if you use not on true it becomes false. So "not true" means false. Simple. In programming languages we use the ! to mean false. So if you have a variable called "done" then !done means "not done". You might use it to check the progress of a process or something.

"And" is true if both variables are true, false otherwise. For example, say "I eat if I am hungry and I have food available." See? I can''t eat if I don''t have food, and I wont eat if I''m not hungry. The symbol for and is &&

"Or" is different. I will run if I am late or if I am being chased. So if one or both of the conditions are true it will be true, otherwise false. The symbol for or is ||
CLICK HERE
---START GEEK CODE BLOCK---GCS/M/S dpu s:+ a---- C++ UL(+) P(++) L+(+) E--- W++ N+ o K w(--) !O !M !V PS- PE+Y+ PGP+ t 5 X-- R tv+ b+ DI+ D G e* h! r-- !x ---END GEEK CODE BLOCK---

This topic is closed to new replies.

Advertisement
Advertisement
Advertisement