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

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, 2845👍, 0💬

Referring to the sample code above, what is the type of T2 in the object ::f?
template&lt;class T = int&gt; class Foo { public: template&lt;class T2 = T&gt; class InnerFoo { T2 t2; }; static InnerFoo&lt;long&gt; *f; }; Foo&lt;double&gt; f; Referring to the sample code above, what is the type of T2 in the object ::f? 1) double 2) t2 3) char 4) i...
2012-04-20, 2843👍, 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, 2843👍, 0💬

Name some pure object oriented languages. C++
Name some pure object oriented languages. C++ Smalltalk, Java, Eiffel, Sather.
2012-01-13, 2834👍, 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, 2832👍, 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, 2815👍, 0💬

What is function overloading and operator overloading?
What is function overloading and operator overloading? Function overloading: C++ enables several functions of the same name to be defined, as long as these functions have different sets of parameters (at least as far as their types are concerned). This capability is called function overloading. When...
2012-01-25, 2809👍, 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, 2800👍, 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, 2789👍, 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, 2787👍, 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, 2785👍, 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, 2772👍, 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, 2754👍, 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, 2740👍, 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, 2702👍, 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, 2695👍, 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, 2665👍, 0💬

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