English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm learning C++ with a how-to book and am very new, so please bear with me. What does the term "int" mean? How/why is it used? Is there a specific reason why it's in lowercase?

2007-02-26 19:41:09 · 5 answers · asked by df.boltthrower 2 in Computers & Internet Programming & Design

5 answers

and int is as he said. it can only stor real number(not decimal point) and the reason its like int adn blue is because c++ is object orientated adn the 'int' is a keyword. meaning it cant be used a a name for a variable. here is a site that will realy help you with your c++, jsut dont give up....

http://www.fredosaurus.com/notes-cpp/index.html

2007-02-26 19:58:58 · answer #1 · answered by origamix60 3 · 1 0

As many have said, int is short for integer. It is usually used as a variable declaration:

int x = 5;

Declares a variable x of type integer, and assigns it a default value of 5. It can also be used as a casting variable:

long bigNumber = 3845757839238477;
int v = (int)bigNumber;

Here, an integer named v is declared and is assigned the value of the long v. A long is just like an integer, except it can have a wider range of values, hence the name long! (it's longer than int). Here I used the 'int' statement to cast bigNumber to an integer and assign it to v.

2007-02-27 03:14:53 · answer #2 · answered by Pfo 7 · 0 0

int is integer number; no reason for being lowercase but just convenient to do so.

Integer numbers are whole numbers, this kind of number in computers are more efficient and stocastic to use than float. If you want an elaboration on fractional numbers within computers wiki the terms "floating point" and "fixed point".

2007-02-26 19:57:21 · answer #3 · answered by Andy T 7 · 1 0

int is short form of Integer. int means the type of variable that stores the integer value. eg. int i. so i is a variable that can store only integer value like 1,2,3,etc but not something like 1.2 or 1.5. int variables have 2 bits. this is just introductory. u can google for more information.

2007-02-26 21:32:16 · answer #4 · answered by Anonymous · 1 0

"int" is shorthand for Integer, meaning a Number!

Happy Coding! And please rate me as best Answer! ;)

2007-02-26 19:45:32 · answer #5 · answered by Anonymous · 1 0

fedest.com, questions and answers