You can find out by using 2 pointers. One of them goes 2 nodes each time. The second one goes at 1 nodes each time. If there is a cycle, the one that goes 2 nodes... Read more »
You can do the Echo $RANDOM. It will return a undefined variable if you are from the C-Shell, just a return prompt if you are from the Bourne shell, and a 5 digit... Read more »
A class is made abstract by declaring one or more of its virtual functions to be pure. A pure virtual function is one with an initializer of = 0 in its declaration
Read more »
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... Read more »
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,... Read more »
A static variable declared outside of any function is accessible only to all the functions defined in the same file (as the static variable). However, a global variable... Read more »
The void pointer is useful becuase it is a generic pointer that any pointer can be cast into and back again without loss of information.
Read more »
It permits a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope.
Read more »
Two.
There are two formats for initializers in C++ as shown in the example that follows. The first format uses the traditional C notation. The second format uses... Read more »
Virtual Methods are used to use the polymorphisms feature in C++. Say class A is inherited from class B. If we declare say function f() as virtual in class B and... Read more »
Multiple inheritance is a feature in C++ by which one class can be of different types. Say class teachingAssistant is inherited from two classes say teacher and... Read more »
An argument can be passed in two ways. They are Pass by Value and Passing by Reference.
Passing by value: This method copies the value of an argument into the formal... Read more »
a) In overloading, there is a relationship between methods available in the same class whereas in overriding, there is relationship between a superclass method and... Read more »
A super class is a class that is inherited whereas sub class is a class that does the inheriting.
Read more »
“=” is an assignment operator while, “==” is comparative operator
a=b; //b’s value is stored in a
if( a==b) // a’s value is compared with b
Read more »
sprintf: a function that puts together a string, output goes to an array of char instead of stdout
printf: prints to stdout
Read more »
malloc: allocate n bytes
calloc: allocate m times n bytes initialized to 0
Read more »
C++ places greater emphasis on type checking, compiler can diagnose every diff between C and C++
1. structures are a way of storing many different values in variables... Read more »
1. Treated like macro definitions by C++ compiler.
2. Meant to be used if there’s a need to repetitively execute a small block if code which is smaller.
3. Always... Read more »
Constructor is a member function of the class, with the name of the function being the same as the class name. It also specifies how the object should be initialized.Ways... Read more »