1) 'b' is the character literal i.e. its type is char. And"b" is the string literal. Its type is char* (or C++ std::string
class).
2) The main function is the program entry point - without itprogram can't be started. Also main has its special signature:
//C examples
int main()
{
//your code
return 0;//0 if your program ends with success
}
int main(int argc, char** argv)
{
//yourcode, where you use command line args stored in argv parameter
return 0;//if success
}
//Note: Windows doesn't use return value
//C++ examples
//C examples are allowed tooplus:
void main()
{
//your code
}
void main(int argc, char** argv)
{
//your code
}
3) <iostream.h>(or<iostream>) is standard C++ library. It manages by Input/Output streams,
It has cin, cout, cerr and clog objects, which are the standard I/O streams. It
also has some input and output manipulators(endl, hex, ...). All these items
are contained in namespace called std.
4) Variable is the pseudonym of memory(RAM) cage, thatcontains some type instance. If you want to assign this value to variable with
another(and incastable) type, program will not compiled. There are these
standard types(C++):
bool -> true or false; //C hasn't bool type
char -> 0..255;
short -> -32 768..32 767
int -> -2 147 483 648..2 147 483 647
long -> -9 223 372 036 854 775 808..9 223 372 036 854 775808
float -> 3.4 e +/- 38
double -> 1.7 e +/- 308
Comments
Leave a comment