<< < 1 2 3 4 5 6 7 8 > >>   Sort: Rank

What’s the best way to declare and define global variables?
What’s the best way to declare and define global variables? The best way to declare global variables is to declare them after including all the files so that it can be used in all the functions.
2012-03-06, 2534👍, 0💬

How do you decide which integer type to use?
How do you decide which integer type to use? It depends on our requirement. When we are required an integer to be stored in 1 byte (means less than or equal to 255) we use short int, for 2 bytes we use int, for 8 bytes we use long int. A char is for 1-byte integers, a short is for 2-byte integers, a...
2012-03-05, 2867👍, 0💬

Anything wrong with this code? T *p = 0; delete p;
Anything wrong with this code? T *p = 0; delete p; Yes, the program will crash in an attempt to delete a null pointer.
2012-03-05, 4330👍, 0💬

Anything wrong with this code? ......
Anything wrong with this code? T *p = new T[10]; delete p; Everything is correct, Only the first element of the array will be deleted”, The entire array will be deleted, but only the first element destructor will be called.
2012-03-02, 2669👍, 0💬

What problems might the following macro bring to the application?
What problems might the following macro bring to the application? #define sq(x) x*x
2012-03-02, 2548👍, 0💬

You’re given a simple code for the class BankCustomer. Write the following functions ...
You’re given a simple code for the class BankCustomer. Write the following functions ... You’re given a simple code for the class BankCustomer. Write the following functions: * Copy constructor * = operator overload * == operator overload * + operator overload (customers’ balances should be added u...
2012-03-01, 2590👍, 0💬

Explain which of the following declarations will compile and what will be constant ...
Explain which of the following declarations will compile and what will be constant ... Explain which of the following declarations will compile and what will be constant - a pointer or the value pointed at: * const char * * char const * * char * const Note: Ask the candidate whether the first declar...
2012-03-01, 2524👍, 0💬

What is an HTML tag? C++
What is an HTML tag? C++ Answer: An HTML tag is a syntactical construct in the HTML language that abbreviates specific instructions to be executed when the HTML script is loaded into a Web browser. It is like a method in Java, a function in C++, a procedure in Pascal, or a subroutine in FORTRAN.
2012-02-29, 2539👍, 0💬

Why are arrays usually processed with for loop?
Why are arrays usually processed with for loop? The real power of arrays comes from their facility of using an index variable to traverse the array, accessing each element with the same expression a[i]. All the is needed to make this work is a iterated statement in which the variable i serves as a c...
2012-02-29, 2555👍, 0💬

What’s the output of the following program? Why?
What’s the output of the following program? Why? #include &lt;stdio.h&gt; main() { typedef union { int a; char b[10]; float c; } Union; Union x,y = {100}; x.a = 50; strcpy(x.b,\"hello\"); x.c = 21.50; printf(\"Union x : %d %s %f \n\",x.a,x.b,x.c ); printf(\"Union y :%d %s%f \n\",y.a,y.b,y.c)...
2012-02-27, 2554👍, 0💬

How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Why is it difficult to stor
How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Why is it difficult to store linked list in an array? How can you find the nodes with repetetive data in a linked list? Write a prog to accept a given string in any order and flash error if any of the char...
2012-02-27, 2694👍, 0💬

What is polymorphism? Explain with an example?
What is polymorphism? Explain with an example? "Poly" means "many" and "morph" means "form". Polymorphism is the ability of an object (or reference) to assume (be replaced by) or become many different forms of object. Example: function overloading, function overriding, virtual functions. Another exa...
2012-02-24, 2585👍, 0💬

What do you mean by pure virtual functions?
What do you mean by pure virtual functions? A pure virtual member function is a member function that the base class forces derived classes to provide. Normally these member functions have no implementation. Pure virtual functions are equated to zero. class Shape { public: virtual void draw() = 0; };
2012-02-24, 2559👍, 0💬

What is a scope resolution operator?
What is a scope resolution operator? A scope resolution operator (::), can be used to define the member functions of a class outside the class.
2012-02-23, 2568👍, 0💬

What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator.
What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator. An internal iterator is implemented with member functions of the class that has items to step through. .An external iterator is implemented as a separate class that can be "at...
2012-02-23, 2682👍, 0💬

What are virtual functions? C++
What are virtual functions? C++ A virtual function allows derived classes to replace the implementation provided by the base class. The compiler makes sure the replacement is always called whenever the object in question is actually of the derived class, even if the object is accessed by a base poin...
2012-02-22, 2688👍, 0💬

What is abstraction? C++
What is abstraction? C++ Abstraction is of the process of hiding unwanted details from the user.
2012-02-22, 2661👍, 0💬

Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?
Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array? Mergesort always makes recursive calls to sort subarrays that are about half size of the original array, resulting in O(n log n) time.
2012-02-21, 2583👍, 0💬

What is friend function? C++
What is friend function? C++ As the name suggests, the function acts as a friend to a class. As a friend of a class, it can access its private and protected members. A friend function is not a member of the class. But it must be listed in the class definition.
2012-02-21, 2757👍, 0💬

What is a class? C++
What is a class? C++ Class is a user-defined data type in C++. It can be created to solve a particular kind of problem. After creation the user need not know the specifics of the working of a class.
2012-02-20, 2601👍, 0💬

Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through
Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321]. quicksort ((data + 222), 100);
2012-02-20, 2617👍, 0💬

What is the difference between an object and a class?
What is the difference between an object and a class? Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects. - A Class is static. All of the attributes of a class are fixed before, during, and after the execution o...
2012-02-17, 2641👍, 0💬

What are 2 ways of exporting a function from a DLL?
What are 2 ways of exporting a function from a DLL? 1.Taking a reference to the function from the DLL instance. 2. Using the DLL ’s Type Library
2012-02-17, 2686👍, 0💬

What do you mean by binding of data and functions?
What do you mean by binding of data and functions? Encapsulation.
2012-02-16, 2618👍, 0💬

<< < 1 2 3 4 5 6 7 8 > >>   Sort: Rank