1
Q:

What is the output of this program ?

       #include
        using namespace std;
        int n(char, int);
        int (*p) (char, int) = n;
        int main()
        {
            (*p)('d', 9);
            p(10, 9);
            return 0;
        }
        int n(char c, int i)
        {
            cout << c <<  i;
            return 0;
        }

A) d99 B) d9d9
C) d9 D) compile time error

Answer:   A) d99



Explanation:

In this program, we have declared the values as integer instead of character, So it is printing as d99 but it will not arise an error.

Subject: C++
Q:

What do you mean by inline function?

Answer

An inline function is a function that is expanded inline when invoked.ie. the compiler replaces the function call with the corresponding function code. An inline function is a function that is expanded in line when it is invoked. That is the compiler replaces the function call with the corresponding function code (similar to macro)

Report Error

View answer Workspace Report Error Discuss

Subject: C++
Job Role: Software Architect

1 4976
Q:

What do you mean by reference variable in c++?

Answer

A reference variable provides an alias to a previously defined variable.


Data type & reference-name = variable name

Report Error

View answer Workspace Report Error Discuss

Subject: C++
Job Role: Software Architect

0 4942
Q:

Which among the following are not the c++ tokens

A) Identifiers B) keywords
C) Strings D) None
 
Answer & Explanation Answer: D) None

Explanation:

All the above listed options are c++ tokens .They  include:

             - keywords

             - Identifiers

             - Constants

             - Strings

             - operators

Report Error

View Answer Report Error Discuss

Filed Under: C++
Exam Prep: GATE

4 4848
Q:

Define Structure in C++.?

Answer

The C++ programming technique allows defining user defined datatypes through structure. The


syntax to declare structure is as follows:


struct student


{


char name[100]


char address[250]


};

Report Error

View answer Workspace Report Error Discuss

Subject: C++

0 2069
Q:

What is function prototype in C++?

Answer

A function prototype is a declaration of a function that omits the function body. It specifies the function’s name, argument types and return type.


E.g. int add(int,int)

Report Error

View answer Workspace Report Error Discuss

Subject: C++
Job Role: Software Architect

0 3111
Q:

What is the data structures used to perform recursion?

Answer

Stack. Because of its LIFO (Last In First Out) property it remembers its ‘caller’ so knows whom to return when the function has to return. Recursion makes use of system stack for storing the return addresses of the function calls. Every recursive function has its equivalent iterative (non-recursive) function. Even when such equivalent iterative procedures are written, explicit stack is to be used.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

3 6309
Q:

List out the areas in which data structures are applied extensively?

Answer

Compiler Design,


 Operating System,


 Database Management System,


Statistical analysis package,


Numerical Analysis,


 Graphics,


 Artificial Intelligence,


 Simulation

Report Error

View answer Workspace Report Error Discuss

Subject: C++

4 4256
Q:

Define void pointer using C++.?

Answer

In C++, void represents the absence of type, so void pointers are pointers that point to a value that has no type. The void pointers can point to any data type.


You can declare void pointer as follows:


void *p;

Report Error

View answer Workspace Report Error Discuss

Subject: C++
Job Role: Software Architect

0 3554