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

How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters? Answer1 If you want the code to be even slightly readable, you will use typedefs. typedef char* (*functiontype_one)(void); typedef functiontype_one (*functiontype_two)(void); functi...
2012-03-09, 3138👍, 0💬

Describe Stacks and name a couple of places where stacks are useful.
Describe Stacks and name a couple of places where stacks are useful. A Stack is a linear structure in which insertions and deletions are always made at one end, called the top. This updating policy is called last in, first out (LIFO). It is useful when we need to check some syntex errors, such as mi...
2012-04-17, 3136👍, 0💬

Write a function that swaps the values of two integers, using int* as the argument type.
Write a function that swaps the values of two integers, using int* as the argument type. void swap(int* a, int*b) { int t; t = *a; *a = *b; *b = t; }
2012-01-31, 3133👍, 0💬

What does extern mean in a function declaration?
What does extern mean in a function declaration? Using extern in a function declaration we can make a function such that it can used outside the file in which it is defined. An extern variable, function definition, or declaration also makes the described variable or function usable by the succeeding...
2012-03-06, 3124👍, 0💬

What is a Null object? C++
What is a Null object? C++ It is an object of some class whose purpose is to indicate that a real object of that class does not exist. One common use for a null object is a return value from a member function that is supposed to return an object with some specified properties but cannot find such an...
2012-01-10, 3123👍, 0💬

What is the difference between declaration and definition?
What is the difference between declaration and definition? The declaration tells the compiler that at some later point we plan to present the definition of this declaration. E.g.: void stars () //function declaration The definition contains the actual implementation. E.g.: void stars () // declarato...
2012-01-25, 3121👍, 0💬

What methods can be overridden in Java?
What methods can be overridden in Java? 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.
2012-03-27, 3107👍, 0💬

What is the difference between Mutex and Binary semaphore?
What is the difference between Mutex and Binary semaphore? semaphore is used to synchronize processes. where as mutex is used to provide synchronization between threads running in the same process.
2012-03-26, 3105👍, 0💬

Assignment Operator - What is the diffrence between a "assignment operator" and a "copy constructor"?
Assignment Operator - What is the diffrence between a "assignment operator" and a "copy constructor"? Answer1. 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: compl...
2012-03-30, 3102👍, 0💬

What is an incomplete type? C++
What is an incomplete type? C++ Incomplete types refers to pointers in which there is non availability of the implementation of the referenced location or it points to some location whose value is not available for modification. int *i=0x400 // i points to address 400 *i=0; //set the value of memory...
2012-01-06, 3102👍, 0💬

Explain term POLIMORPHISM and give an example using eg. SHAPE object: If I have a base class SHAPE, how would I define DRAW meth
Explain term POLIMORPHISM and give an example using eg. SHAPE object: If I have a base class SHAPE, how would I define DRAW methods for two objects CIRCLE and SQUARE Answer1 POLYMORPHISM : A phenomenon which enables an object to react differently to the same function call. in C++ it is attained by u...
2012-02-08, 3101👍, 0💬

You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. new() and malloc()
You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. new() and malloc() Answer1 1.) “new and delete” are preprocessors while “malloc() and free()” are functions. [we dont use brackets will calling new or delete]. 2.) no need of allocate the m...
2012-02-06, 3097👍, 0💬

What is a conversion constructor C++?
What is a conversion constructor C++? A constructor that accepts one argument of a different type.
2012-03-16, 3092👍, 0💬

Name 7 layers of the OSI Reference Model?
Name 7 layers of the OSI Reference Model? -Application layer -Presentation layer -Session layer -Transport layer -Network layer -Data Link layer -Physical layer
2012-04-13, 3089👍, 0💬

What is a default constructor? C++
What is a default constructor? C++ Default constructor WITH arguments class B { public: B (int m = 0) : n (m) {} int n; }; int main(int argc, char *argv[]) { B b; return 0; }
2012-03-15, 3089👍, 0💬

Can you be bale to identify between Straight- through and Cross- over cable wiring? and in what case do you use Straight- throug
Can you be bale to identify between Straight- through and Cross- over cable wiring? and in what case do you use Straight- through and Cross-over? 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 cab...
2012-03-29, 3086👍, 0💬

What do you mean by Stack unwinding? C++
What do you mean by Stack unwinding? C++ It is a process during exception handling when the destructor is called for all local objects between the place where the exception was thrown and where it is caught.
2012-01-11, 3082👍, 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, 3080👍, 0💬

If this is a complete translation unit, what can be said about the variable "MaxEntries"?
const int MaxEntries = 10; extern int entries[MaxEntries]; If this is a complete translation unit, what can be said about the variable "MaxEntries"? 1) It can only be used within the translation unit shown in the sample. 2) It cannot be used as a case value in a switch statement. 3) It becomes acces...
2012-04-24, 3076👍, 0💬

Differentiate between a template class and class template.C++
Differentiate between a template class and class template.C++ Template class: A generic definition or a parameterized class not instantiated until the client provides the needed information. It’s jargon for plain templates. Class template: A class template specifies how individual classes can be con...
2012-01-03, 3071👍, 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, 3065👍, 0💬

If you hear the CPU fan is running and the monitor power is still on, but you did not see any thing show up in the monitor scree
If you hear the CPU fan is running and the monitor power is still on, but you did not see any thing show up in the monitor screen. What would you do to find out what is going wrong? I would use the ping command to check whether the machine is still alive(connect to the network) or it is dead.
2012-03-29, 3059👍, 0💬

What is class invariant? C++
What is class invariant? C++ A class invariant is a condition that defines all valid states for an object. It is a logical condition to ensure the correct working of a class. Class invariants must hold when an object is created, and they must be preserved under all operations of the class. In partic...
2012-01-10, 3058👍, 0💬

Describe PRIVATE, PROTECTED and PUBLIC – the differences and give examples.
Describe PRIVATE, PROTECTED and PUBLIC – the differences and give examples. class Point2D{ int x; int y; public int color; protected bool pinned; public Point2D() : x(0) , y(0) {} //default (no argument) constructor }; Point2D MyPoint; You cannot directly access private data members when they are de...
2012-02-13, 3057👍, 0💬

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