Come and Join Us at VU Social
Come and Join Us at VU Social
Come and Join Us at VU Social
malloc
calloc
realloc
free
#ndefine
list of preprocessors
#include #include filename #define #undef #ifdef #ifndef #if #else
#elif #endif #error #line #pragma #assert
True
False
if we are allocating an array of objects, there is no way to pass arguments to objects
constructors. Therefore it is required that the objects that are stored in such an array
have a no-argument constructor.
Class templates can have friends. A class or class template, function, or function
template can be a friend to a template class. Friends can also be specializations of a class
template or function template, but not partial specializations.
6,8,6
6,6,8
6,8,8
6,6,6
The malloc function differs from calloc in the way that the space allocated by malloc is
not initialized and contains any values initially.
Templates are type-safe. This is because the types that templates act upon are known at
compile time, so the compiler can perform type checking before errors occur.
53
Rational: it will take 123 as octal and print it in hex form which is 53.
Answer:
void String::operator = ( const String &other )
{ int length ;
length = other.length();
delete buf;
buf = new char [length + 1];
strcpy( buf, other.buf );