There are 3 types of STL containers:
1. Adaptive containers like queue, stack
2. Associative containers like set, map
3. Sequence containers like vector, deque
RTTI stands for "Run Time Type Identification". In an inheritance hierarchy, we can find out the exact type of the objet of which it is member. It can be done by using:
1) dynamic id operator
2) typecast operator
RTTI is defined as follows: Run Time Type Information, a facility that allows an object to be queried at runtime to determine its type. One of the fundamental principles of object technology is polymorphism, which is the ability of an object to dynamically change at runtime.
In assignment operator, you are assigning a value to an existing object. But in copy constructor, you are creating a new object and then assigning a value to that object. For example:
c1=c2; //this is assignment
complex c3=c2; //copy constructor
A copy constructor is used to initialize a newly declared variable from an existing variable. This makes a deep copy like assignment, but it is somewhat simpler:
There is no need to test to see if it is being initialized from itself.
There is no need to clean up (eg, delete) an existing value (there is none).
A reference to itself is not returned.
I would use the ping command to check whether the machine is still alive(connect to the network) or it is dead.
Straight-through is type of wiring that is one to connection, Cross- over is type of wiring which those wires are got switched
We use Straight-through cable when we connect between NIC Adapter and Hub. Using Cross-over cable when connect between two NIC Adapters or sometime between two hubs.
The defining traits of an object-oriented langauge are:
In C++ terminology, all public methods in Java are virtual. Therefore, all Java methods can be overwritten in subclasses except those that are declared final, static, and private.
Overloading a method (or function) in C++ is the ability for functions of the same name to be defined as long as these methods have different signatures (different set of parameters). Method overriding is the ability of the inherited class rewriting the virtual method of the base class.
semaphore is used to synchronize processes. where as mutex is used to provide synchronization between threads running in the same process.
char *cptr = 0?2000;
long *lptr = 0?2000;
printf(" %x %x", cptr, lptr);
}Will it execute or not?
For Q2: As above, won't compile because main must return int. Also, 0x2000 cannot be implicitly converted to a pointer (I assume you meant 0x2000 and not 0?2000.)
Compile with VC7 results following errors:
error C2440: ‘initializing' : cannot convert from ‘int' to ‘char *'
error C2440: ‘initializing' : cannot convert from ‘int' to ‘long *'
Not Excute if it is C++, but Excute in C.
[$]> g++ point.c
point.c: In function `int main()':
point.c:4: error: invalid conversion from `int' to `char*'
point.c:5: error: invalid conversion from `int' to `long int*'
[$] etc > gcc point.c
point.c: In function `main':
point.c:4: warning: initialization makes pointer from integer without a cast
point.c:5: warning: initialization makes pointer from integer without a cast
[$] etc > ./a.exe