C++ console application

Posts 1630 of 40 · Page 2 of 3
Quote Originally Posted by faceofdevil View Post
Code:
Please enter a number
>23
You entered 23, yes or no?
>yes

IF yes then
yeah, thats right, I got it...
else
wtf? I got it wrong? But my psychic powers never fail me...
>anything at all
Do you like wafflezzz?????
>no
if no then 
WTF??? YOU DON'T LIKE WAFFLES?
else 
do you like syrup on your waffles?
if yes then
If you applyed your english skills to that of your math skills you would of understand what you where trying to build. In any project you do this will always come up.
No, I don't understand. The ONLY thing I understand about if statements is that its

if

stuff here

else

stuff here

endif

I do NOT know what it does, how to use it or where the parentheses go. I'm new to c++...
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:

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)
     }
Quote Originally Posted by VvITylerIvV View Post
Because, I don't understand any If statements, I don't understand what the hell char is and what the hell int is. I asked for an explanation to what it is. Ok, now sure I can use it but I don't know what the **** it is.
I did accept the help, that one choob helped me. And I thanked him for it.


I think if I read it I would've been confused. I don't understand if statements, char and ints, I want to learn not be able to use.



I use a $16,000 program called visual studio ultimate. (I hope I don't get sued...)
buy a book.
in every book chars, ints and if statements are explained in the first chapters.
-_-. 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]
Quote Originally Posted by Auxilium View Post
-_-. 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]
yap, a little support here:




Decimal to Char
Quote Originally Posted by Auxilium View Post
-_-. 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]

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]
Quote Originally Posted by VvITylerIvV View Post
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]
No.....Char is only 1 char.
to have a string youd have to do this
[php]#include <string>

int main()
{
std::string faceFloor;
string faceFloor = 'I facefloor what the fuck';[/php]

Or you could just use an array of chars


And you only put ' ' around text
Quote Originally Posted by Auxilium View Post

No.....Char is only 1 char.
to have a string youd have to do this
[php]#include <string>

int main()
{
std::string faceFloor;
string faceFloor = 'I facefloor what the fuck';[/php]

Or you could just use an array of chars


And you only put ' ' around text


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::
Quote Originally Posted by VvITylerIvV View Post
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++
Quote Originally Posted by VvITylerIvV View Post
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::
go read a book
Quote Originally Posted by Toxic Waltz View Post
go read a book
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]
Quote Originally Posted by VvITylerIvV View Post
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]
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..
Quote Originally Posted by 'Bruno View Post
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..
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.
Quote Originally Posted by VvITylerIvV View Post
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..
yes std is a namespace, and you declare a variable like this: char x;

NOT THIS: std::char x;
Posts 1630 of 40 · Page 2 of 3
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?