1
Q:

What is the output of this program?

#include
        using namespace std;
        struct sec {
            int a;
            char b;
        };
        int main()
        {
            struct sec s ={25,50};
            struct sec *ps =(struct sec *)&s;
            cout << ps->a << ps->b;
            return 0;
        }

A) 252 B) 253
C) 254 D) 262

Answer:   A) 252



Explanation:

In this program, We are dividing the values of a and b, printing it.

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 4977
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 4943
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 4852
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 2070
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 3114
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 6312
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 4261
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