.
. . ...
" ++" .
-, . , . , ( ) , . . , . . , , . . ! , , .
: Google. .
: , () , , . :
class Foo
{
public:
int i;
Foo(int argI) : i(argI) { }
};
int
main()
{
Foo f(2),g(3);
Foo h = f;
}
, f (2) g (3), Foo (int). Foo h = f h , Foo (int). (Caveat Emptor: gcc/g++ 3.4.4 4.0.1. ...)
, operator =() , .
: (), , . , g (3.2), . int Foo (int). ( [should!] .)
. Foo :
operator int() { return i; }
:
cout << "Foo h = " << h << endl;
h int.
. double/long-double/float int/short/long/etc signed/unsigned .. (, , . -1 unsigned ... , , !)
(void *). :
void voidFunction (void * v) { cout << "v= " << v << endl; }
int main() { Foo z(2); voidFunction(&z); }
, , , , .
, / .
, (printf (format,...)). (, #include < stdarg.h > . va_start(), va_arg(), va_end().) , , , , ...
, #define FOO (X), ... , . , , , ...
templating, , , ...
: , ... !