<< < 3 4 5 6 7 8   Sort: Date

How do I initialize a pointer to a function?
How do I initialize a pointer to a function? This is the way to initialize a pointer to a function void fun(int a) { } void main() { void (*fp)(int); fp=fun; fp(1); }
2012-03-12, 2526👍, 0💬

What is the difference between realloc() and free()?
What is the difference between realloc() and free()? The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, no action will occur. The realloc subrout...
2012-01-24, 2526👍, 0💬

What are the advantages of inheritance?
What are the advantages of inheritance? It permits code reusability. Reusability saves time in program development. It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional.
2012-01-26, 2523👍, 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, 2521👍, 0💬

Write a Struct Time where integer m, h, s are its members
Write a Struct Time where integer m, h, s are its members struct Time { int m; int h; int s; };
2012-01-20, 2520👍, 0💬

What is the above sample code an example of?
class Foo; What is the above sample code an example of? 1) A class constructor 2) A class object instantiation 3) A class definition 4) A class declaration 5) A syntax error
2012-04-25, 2519👍, 0💬

What is a container class? C++ What are the types of container classes?
What is a container class? C++ What are the types of container classes? A container class is a class that is used to hold objects in memory or external storage. A container class acts as a generic holder. A container class has a predefined behavior and a well-known interface. A container class is a ...
2012-01-16, 2514👍, 0💬

What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?
What is the word you will use when defining a function in base class to allow this function to be a polimorphic function? virtual
2012-02-16, 2510👍, 0💬

When is a template a better solution than a base class?
When is a template a better solution than a base class? When you are designing a generic class to contain or otherwise manage objects of other types, when the format and behavior of those other types are unimportant to their containment or management, and particularly when those other types are unkn...
2012-03-20, 2509👍, 0💬

Write a fucntion that will reverse a string.
Write a fucntion that will reverse a string. char *strrev(char *s) { int i = 0, len = strlen(s); char *str; if ((str = (char *)malloc(len+1)) == NULL) /*cannot allocate memory */ err_num = 2; return (str); } while(len) str[i++]=s[–len]; str[i] = NULL; return (str); }
2012-04-11, 2499👍, 0💬

How do you write a function that can reverse a linked-list?
How do you write a function that can reverse a linked-list? void reverselist(void) { if(head==0) return; if(head-&gt;next==0) return; if(head-&gt;next==tail) { head-&gt;next = 0; tail-&gt;next = head; } else { node* pre = head; node* cur = head-&gt;next; node* curnext = cur-&...
2012-01-26, 2495👍, 0💬

What is the two main roles of Operating System?
What is the two main roles of Operating System? As a resource manager As a virtual machine
2012-01-23, 2494👍, 0💬

What is the difference between a Java application and a Java applet?
What is the difference between a Java application and a Java applet? The difference between a Java application and a Java applet is that a Java application is a program that can be executed using the Java interpeter, and a JAVA applet can be transfered to different networks and executed by using a w...
2012-04-12, 2489👍, 0💬

How do you find out if a linked-list has an end? (i.e. the list is not a cycle)
How do you find out if a linked-list has an end? (i.e. the list is not a cycle) 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 each time will eventually meet the one that goes slower. ...
2012-01-18, 2453👍, 0💬

Describe run-time type identification.
Describe run-time type identification. The ability to determine at run time the type of an object by using the typeid operator or the dynamic_cast operator.
2012-03-22, 2451👍, 0💬

What’s the auto keyword good for?
What’s the auto keyword good for? Answer1 Not much. It declares an object with automatic storage duration. Which means the object will be destroyed at the end of the objects scope. All variables in functions that are not declared as static and not dynamically allocated have automatic storage duratio...
2012-03-08, 2445👍, 0💬

How do you find out if a linked-list has an end? (i.e. the list is not a cycle)
How do you find out if a linked-list has an end? (i.e. the list is not a cycle) 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 each time will eventually meet the one that goes slower. ...
2012-01-24, 2437👍, 0💬

<< < 3 4 5 6 7 8   Sort: Date