newb question~

I'm using Dev-C++ to practice code from the first tutorial on this site, I can get the first one to work the one that is ran in Console Application. I cannot get the other ones to work although they seem to be the same and im pretty sure im not leaving things out because i copy and paste. I was wondering if theyre supposed to be in something else than console application? If anyone knows or wants to help me my aim is Anima46i2 any help is greatly appreciated thanks.

>>int - a,b,c,d . I thought int stood for numbers? i dont understand that.<<
Well, yes int is for numbers in essence, but you can name your variables anything you like (within the rules). Also characters are actually numbers in disguise anyway, checkout the ASCII chart to see what I mean.

>>Char - letter. I thought char was supposed to be a single character like "a" or "b"<<
Yes, a char holds a single byte, or one character.

>>Float - The_float . I thought float was supposed to be a number with a decimal point<<
Yes, that's basically correct.

to answer your question about floats (and other variables at the same time too i guess), you can name a float type variable anything you want (almost) but it's value has to be a number with a decimal place, for example, you could have this:

int main()
{
float a_float = "this is a float"; //Because a_float has to
int a_number = "this is a number"; //equal a number with a
return 0; //decimal point.
}
/*It's the same with any other variable, it can be called almost anything, but it has to equal it's type, ie. an int has to equal a number, a char has to equal a character (unless it's a string, but don't worry about that yet) */

Edit: Woah sorry my post stretched out so far to the right, but I don't know how to fix it.

i meant that my program closes whenever it asks for input like in the "please enter a number one" when you enter a number you cant enter it because it will close . I know how to keep the window open until a key is pressed...its just that i dont want it to close after the key is pressed .

The faq has a topic on how to keep the window open. Essentially, your program finishes so the window closes. The output was displayed, but it all happened so fast, it looks like it didn't work. Put these lines as the last lines of your program:

and the variable name does not indicate the type of the variable in anyway. So this statment:

int a, b, c, d

declares four int variables with the names:

a
b
c
d

Just because the variable names above are single letters does not mean they contain char's. Remember a variable name can be anything and does not indicate what type it is. Similarly a char variable can be named anything too:

ch687
ACharVar12
dog76
letter54
MyTestScore
a1000
z

and if all of those variables are declared as type char, they will only be able to store one char. Finally, for floats the same rules apply. The variable name can be anything:

MyFloat
a
x
y
anInterstingVar
MyTestScore

but if those variables are declared floats, then they can contain decimal numbers. Generally, you will name your variables with descriptive names. If you need to declare a variable in order to store a char representing a test score: 'A', 'B', or 'C' you might declare your variable like this:

char EnglishGrade;

If you need an int variable to store the number of students in a class, you might declare your variable like this:

int NumberOfStudents;

If someone said, "I have 4 variables in my program and here are their names:

x
y
ch
AVariable"

Then the person asked you: "What types are those variables?" Your answer would be: "It'is impossible to tell, mister." If he showed you variable names like this:

ThisIsAFloat
ThisIsAChar
ThisIsAnInt

You still could not tell him what the variable types were because he could have declared them like this:

char ThisIsAFloat;

float ThisIsAnInt;

int ThisIsAChar;

That would be a stupid way of naming his variables, but it would be entirely legal.
(Note: technically a variable name can't be ANY sequence of characters--C++ has certain rules about variable names, but they are pretty liberal. As long as you begin the name with a letter, and then use letters, digits or an underscore(e.g.: MY_dog7) after that, you will be fine)