Dracoola (07-02-2013)
Hey everyone.
First off, I'm typing this on my iPhone, so it's gonna be riddled with autocorrect mistakes.
Two, there are now two people banned/blacklisted from my giveaways. SlenderMan and Dudistul. Don't get on my bad side.
But now on to the giveaway:
1. What does the line
"#include <iostream>" do?
2. What does
"cout << asdasdasd << endl;" do?
3. What does
"if (player.alive)" do? Hint: remember the structs
4. Why is this wrong?
"int myFirstNumber = 3.14159;"
5. How do you fix this:
Code:for (int i = 0; i < 10; i++} { cout << i + 4 << endl }
Last edited by 99Pr0bZ; 07-02-2013 at 12:06 PM.
Dracoola (07-02-2013)
Here's what google told me:
1. It is basically a library from which a program gets his instructions.
Exact quote: It tells the compiler, during the preprocessing stage, to find a text file, named iostream, somewhere in the include path and insert it verbatim into the source file being compiled.
2. It prints a line break on a screen.
3. I guess it's a part of the code that does something the coder wrote in case the player is alive. For example: If player is alive, refresh his hp or something i don't know
4. pi is not a whole number. The int (integer) means it has to be a whole number such as 2, 4, 6...
5. It's not separated by semicolons?
If i'm not right in some of these, can you tell me so i can fix it if i am allowed to?
1. It is used in C languages (either C, C++, C#) to include libraries. iostream library allows the user to use basic input output commands (ie cin cout). - I have C++ for dummies book :P
2. Lets take a look at the line:
cout << String/int/variable/anything << endl;
cout - c stands for console. And yes, you guessed it ^_^ out means out. Or output eitherway, out. It's a command to print out whats after the << in the console.
asdasdasd - Variable.
endl; - short way of saying end of the line.
3. If(player.alive) checks whether the boolean I presume is true. If it is true then you'd go on to do the things in the curly brackets {} OffTopic >> :{ (moustache smiley).
4. int myFirstNumber = 3.14159; - int means a whole number. PI is not a whole number. You could use cast ints to change it into a whole number (int)3.141.... Or use a double or a float instead of int.
5.
The for loop ending bracket is a squigly curly bracket. Just like my moustache man has. To fix it you would change the } into )Code:for (int i = 0; i < 10; i++} { cout << i + 4 << endl }
Uhm it also has a quotation mark before the for.... .-. delete that...Code:for (int i = 0; i < 10; i++) { cout << i + 4 << endl }
Edit1: Id love an account :/ I cant seem to get cracked to decompile to create a client :I seems like only would work for me with a premium :I
Last edited by Wampwire; 07-02-2013 at 11:15 AM.
Oh man.
You were so close, but you messed up on one tiny thing.
No, that mistake doesn't involve formatting.
Oh, and yeah. Forgot a close quotation mark. I'll get rid of it. I didn't know how to do Code brackets on my iPhone.
1. What does the line
"#include <iostream>" do? It tells the preprocessor to include the iostream standard file
2. What does
"cout << asdasdasd << endl;" do? prints the varible
3. What does
"if (player.alive)" do? Hint: remember the structs It checks to see if the boolean player.alive returns true and if it does then executes whatever comes next.
4. Why is this wrong?
"int myFirstNumber = 3.14159;" should be a double or float because its a decimal
5. How do you fix this:
Code:
for (int i = 0; i < 10; i++}
{
cout << i + 4 << endl
} there is a } when it should be a )
But now on to the giveaway:
1. What does the line
"#include <iostream>" do? Preprocessor that includes the library 'iostream'
2. What does
"cout << asdasdasd << endl;" do? Prints "asdasdasd" in the console and moves to a new line.
3. What does
"if (player.alive)" do? Hint: remember the structs It's a conditional statement that checks if a player is alive.
4. Why is this wrong?
"int myFirstNumber = 3.14159;" the variable type is an integer, 3.14159 is a float.
5. How do you fix this:
Code:
for (int i = 0; i < 10; i++}
{
cout << i + 4 << endl
}
for(int i=0; i<10; i++)
{
cout << i+4 << endl;
}
Aha! You got it.
The mistake everyone made was that semicolon. Program won't run without it.
I'll PM you as soon as I get home; my iPhone doesn't have my account list.
Don't worry, I'm legit :P
In other news, I hope you guys like these giveaways. I try to think of something original.
I said semicolon tho. Everything else was probably wrong, but still!
In number 5, it should be
endl;
You said surrounded by semicolons. That's not surrounding.
Sorry if this sounds harsh
I suppose you could, but the owner will just change it back, and you won't have access to it anymore
oh..good to know then...
Sent
Enjoy
Worst Giveaway ever.
I do not use any type of messenger outside of MPGH.
Inactive but you can reach me through VM/PM.
I'm sorry?
What about it is bad?