April 23, 2019

Srikaanth

Dassault Systemes C++ Interview Questions Answers

How Can I Disable The "echo" Feature?

The disabling of the echo feature is done with the help of the getpassQ function. The character keys are turned off by using the getpass(3) function.

How Can You Link A C Program With A C Function?

A C program can be linked with a C function with the help of the extern "C" linkage specification. The name mangling in C++ encodes all the codes into the symbol and therefore results in errors. Therefore, the references of these symbols should be avoided by the C compiler. One should have the knowledge about the mangled function and type-safe linkages. During the compilation, with the extern "C" linkage specification, the name mangling feature is turned off to ensure the proper linkage of the C program to the C functions.

How Are The Features Of C++ Different From C?

All the features of C are similar to C++ except some features, such as polymorphism, inheritance, operator overloading which are supported in C++ but not in C language. Both C and C++ language is similar in their functionality but C++ provides with more tools and options.

How Can A Struct In C++ Differs From A Struct In C?

The differences between struct in C++ and C are listed in the following points

 In C and C++, the variables of the structures are public; however, in C, the variable cannot be declared as private or protected. On the contrary, in C++, the variables can be declared as private or protected.
On declaring a struct in C, the addition of the struct keyword is must. On the contrary, there is no need of the struct keyword on declaring struct in C++.
 In C, structures do not have direct functions or methods (procedures). Example, pointers inside the functions. On the other hand, C++ has direct functions or methods, for example classes.
 In C, the initialization cannot be done outside the scope of a structure. However, in C++, the initialization can be done outside the scope of a structure.
 In C, the concept of inheritance is not supported. In C++, the concept of inheritance is fully supported.

What Happens When The Extern "c" Char Func (char*,waste) Executes?

On executing the extern "C" char func (char*,waste), the link to the code compiled by the C compiler can be established by the programmer because the "name mangling" (which includes the tokens that identify the function's return type and the types of its arguments) will be turn off for the function.
Dassault Systemes Most Frequently Asked Latest C++ Interview Questions Answers
Dassault Systemes Most Frequently Asked Latest C++ Interview Questions Answers

Write About The Access Privileges In C++ And Also Mention About Its Default Access Level?

There are three access privileges provided in C++ which are private, protected, and public. The members of a class have private access by default.The public members can be accessed by member functions and by other functions that declare an instance of the class. The private members can be accessed by member functions of the same class. The protected members are included by using the class inheritance. The protected members can be accessed only within the class.

Describe The Role Of The C++ In The Tradeoff Of Safety Vs. Usability?

Earlier in C, encapsulation is meant to hide the information. Encapsulation is included in C by making other class members static in a class to prevent accessing the members by another module. However, the concept of multiple instances is not supported by the encapsulation because it is impossible to directly make multiple instances inside the static class module. If there is a need of multiple instances, a struct is used. On the contrary, encapsulation is not supported by structs.
In C++, a class supports both encapsulation and multiple instances. The class's interface that contains the public member functions and friend functions of the class can be accessed by multiple users. On the other hand, an implementation of the class is defined by the private and protected parts of a class. This encapsulated part forms a struct; thereby, reducing the tradeoff (loosing of one quality as a result of gaining of another quality) between the encapsulation and usability.

Is Recursion Allowed In Inline Functions?

Syntactically, the recursion (calling of the function by itself) is allowed in inline function but practically, the inline functions and their properties do not remain inside the program. Moreover, the compiler is not sure about the depth of the recursion at the time of compilation.

Write About The Scope Resolution Operator?

The scope resolution operator (::) can be used to define the member functions of a program outside the boundary of a class and not within the class specifier. The global scope resolution operator, which is coded as a prefix to the variable's name (for example,:: varname), lets you explicitly reference a global variable from a scope in which a local variable has the same name.

A program can use scope resolution operator (::) to bypass the override of a base class member that a derived class has overridden.

Is It Possible For A Member Function To Delete The Pointer, Named This?

It is possible for a member function to use delete this pointer but on certain conditions.
The conditions which allow the member function to use delete this are listed in the following order

Make sure that the allocation of this (current) object is done through new [] operator only.
Make sure that the invocation of your member function done on this (current) object will be the last member function. It made the calling of the last member function by the current object easy.
Make sure that calling of other member functions and data members should not be done after the line of code which includes delete this.
Examination or comparison of this pointer with other pointers and with NULL, printing or casting it, must be avoided after using the delete this line.

Name The Debugging Methods That Are Used To Solve Problems?

The following are the debugging methods used by C++ to solve problems

 GOB—Allows debugging of the global objects which have the reference
 Forte —Used as a debugger for building the application based on high performance
 Visual ^:udio —Traces the program's source code and supports break-points, watchpoints, and threads
 Tusc —Traces the last call of the system before its termination

Write About The Various Sections Of The Executable Image?

The sections of an executable image are as follows
a. The different sections of data, such as the section of the data which is not initialized and the initialized section of the variable of the data
b. The specific section of the code
c. The allocation of all the static variables is done in the variable section which is initialized.

Subscribe to get more Posts :