C++ console application
So If i kicked you in the butt what else would you do?
what does IF and else mean in this sentence?
i use them alot like examples:
what does IF and else mean in this sentence?
i use them alot like examples:
Code:
// check if banned
if( banned == AL_BANNED )
{
// code here if the player is banned
// check the database if user is banned (flag)
return;
}
else
{
banned = AL_NORMAL;
// update the database account can now login (flag)
}
-_-. Alright. Since im banned on Tails. Im on this account.
Int = Numerical value between -65000 - 65000 or something like that
char = Values 0-255, But the values are character values so 42 is 'a' i think, such as [php]char apple;
apple = 'b';[/php]
Int = Numerical value between -65000 - 65000 or something like that
char = Values 0-255, But the values are character values so 42 is 'a' i think, such as [php]char apple;
apple = 'b';[/php]
Alright, thanks. And yeah, I know character values... I used to speak binary, which requires converting to the hexadecimal value which goes through the numerical values...
And so it would be something like this?
[php]
int number;
number = '2342'; // int variable is a number
char word;
word = 'hello world'; // char variable is character values
[/php]
So char would have to be
[php]
char 'hello';
char 'world';
cout << hello<< world;[/php]
and that would display hello world?
And about strings, I understand that [php#include <string>[/php] is uncluding the string thing, but [php]std::string facefloor;[/php] I know that std:: and string are two seperate things, and that string would just be basically multiple chars?
but wtf is std::
First you are not initializing the char variable correctly. It should be something like:
char var1 = 'h'; // I don't know if multiple chars can be stored with out using array. Here var1 is the variable name and 'h' is its value.
You should use strings for multi-character variables.
@Std: I think its a reference to standard input and output functions.
Correct me if I am wrong, coz I am new to C++
char var1 = 'h'; // I don't know if multiple chars can be stored with out using array. Here var1 is the variable name and 'h' is its value.
You should use strings for multi-character variables.
@Std: I think its a reference to standard input and output functions.
Correct me if I am wrong, coz I am new to C++

I have a different way of learning... Books are useless, thats why I did so poorly in regular school.
I learn through reading tutorials on the internet, getting a general understanding of stuff. Finding out what I'll be learning next and getting regular people to explain it. Books are always overexplaining stuff. In the tutorial that I'm reading, if statements was next, and rather then just reading it - where they will most likely be including other code that I haven't learnt yet - I would rather learn a bit about the if statements, then start reading about them. Make sense?
Books for beginning c++ is like giving a kindergartener a university professor - its all there, but with too much of it.
So [php] std::string[/php] was incorrect? it would be
[php]string 'omg wtf I can kinda code now thanks to these helpful people';[/php]
I learn through reading tutorials on the internet, getting a general understanding of stuff. Finding out what I'll be learning next and getting regular people to explain it. Books are always overexplaining stuff. In the tutorial that I'm reading, if statements was next, and rather then just reading it - where they will most likely be including other code that I haven't learnt yet - I would rather learn a bit about the if statements, then start reading about them. Make sense?
Books for beginning c++ is like giving a kindergartener a university professor - its all there, but with too much of it.
So [php] std::string[/php] was incorrect? it would be
[php]string 'omg wtf I can kinda code now thanks to these helpful people';[/php]
what you call too much of it.. and too much information.. IT IS NEEDED!
It's there for a reason.. for you to know.. and to me it looks like that you are needing it because if you are taking that much to understand a char/string thing. i Advice you to get a book and really read that "useless" stuff that is in it..
It's there for a reason.. for you to know.. and to me it looks like that you are needing it because if you are taking that much to understand a char/string thing. i Advice you to get a book and really read that "useless" stuff that is in it..
Yes, but for example, I wasn't actually supposed to learn std/string at this point. It was just code that I wanted to learn extra, that I saw and knew it would come in handy. If I were to be taught about char, the books would make it far to confusing, they'd include everything else as well, unsigned int, re-explain int, char, float, double, etc. I can't learn that way. It's too much, too fast. With this little information I have, I want to see exactly how far I can push just these simple codes. Then I'll learn another lot, using books and regular people. Books for the bulk of the learning, regular people for pinpointing certain areas. Where I find the regular people, whatever mood I'm in.
If is it a good book, it will explain you the way you need to learn.. Yea.. it gives a lot of info... but let me ask you.. would you be able to tell me the difference between an int? short int? long int? unsigned int? etc? from a double to float... Without checking the web?
You might think that it isn't important right now.. but it is.. and you just should learn it. If you are just going to pass half of the stuff in pointers... you will end up learning anything.
Anyway if you really want it like that.. then sure.. go ahead and all i can tell you is good luck ;x and feel free to ask stuff..
You might think that it isn't important right now.. but it is.. and you just should learn it. If you are just going to pass half of the stuff in pointers... you will end up learning anything.
Anyway if you really want it like that.. then sure.. go ahead and all i can tell you is good luck ;x and feel free to ask stuff..
yes std is a namespace, and you declare a variable like this: char x;
NOT THIS: std::char x;
NOT THIS: std::char x;
This thread is closed for replies.

buy a book.

