Home > Interview Questions > Question About C++

Question About C++

Contents

Run time Error - The errors encountered during execution of the program, due to unexpected input or output are called run-time error. A constant class object’s member variable can be altered by declaring it using mutable storage class specifier. The stream ‘cin’ is by default connected to console input device. The linux programming assignments were designed to get a feel of real time issues and covered lot of areas of uncertainty. Source

Yes. The program shall quit abruptly. Answer : The this pointer is an object pointer which points to the currently calling object, The this pointer is, by default, available to each called member function. Answer : The ios::out is the default mode of ofstream.

C++ Questions And Answers Pdf

Privacy Policy About Us | Contact Us C++ Tutorial for School Students Menu Home Tutorial Assignments Projects Papers Quiz Question : Why main function is special in C++ ? What is Next ? Answer : It is a member function of class with the following unique features.

A variable, which holds an address of a memory location, is known as a Pointer variable (or Simply Pointer). size_t sz = buf->size(); while ( --sz >= 0 ) { /* do something */ } View the answer →The problem in the above code is that --sz >= 0 will A static member function can be invoked using the class name as it exists before class objects comes into existence. C++ Programming Interview Questions I've had my fair share of interviews, more or less successful, and I would like to share with you my experience regarding some questions I had to face.

Privacy Policy & Site Terms About us Contact us Advertise GeeksQuiz Computer Science Quizzes for Geeks ! C++ Multiple Choice Questions Comment Fields marked with an asterisk (*) are required Submit a CommentComment submitted succesfully. Any data type, user-defined or built-in, may be defined as a const, e.g.,: // myInt is a constant (read-only) integer const int myInt = 26; // same as the above (just What is an object?

int i = 5; int j = i++; View the answer →After the above code executes, i will equal 6, but j will equal 5. C++ Interview Questions And Answers It also contains questions on arrays, pointers and structures. What are available mode of inheritance to inherit one class from another? It is recommended that the initialization list has a consistent form: first the call to the base class(es) constructor(s), and then calls to constructors of data members in the order they

C++ Multiple Choice Questions

What is a virtual destructor? So you will end up with two calls before the data member m_name is fully constructed and initialized. C++ Questions And Answers Pdf If "p" is a character pointer then "p++" will increment "p" by 1 byte. C++ Programming Questions Friends provide some degree of freedom in a class' interface design.

Answer : Multipath inheritance may lead to duplication of inherited members from a grandparent base class. this contact form It will immensely help anyone trying to crack a C++ code or an interview.

Here's the list of Best Reference Books in C++ Programming Language. A constant must also be defined at the point of declaration (must have a value) whereas "defines" can be "empty." Code that uses const is inherently protected by the compiler against If a header file is included with in “ “, then the compiler searches for the particular header file first in the current working directory, if not found then in the C++ Programming Questions And Answers Pdf

This, is the pointer variable of the compiler which always holds the current active object’s address. In binary file, there is no delimeter for a line. What would be an alternate way of implementing this that would avoid the problem? have a peek here Question : What is type conversion in C++ ?

Answer : Compiler - It is a program which converts the program written in a programming language to a program in machine language. C++ Interview Questions For Experienced This may be avoided by making the common base class a virtual base class. All the arguments sent are the strings only.

That's it for the first part of this installment.

A C++ program consists of various tokens and a token is either a keyword, an identifier, a constant, a string literal, or a symbol. In the below function both the variables ‘i’ and ‘j’ are automatic variables. A named constant (declared with const) it's like a normal variable, except that its value cannot be changed. C++ Technical Interview Questions GATE CS Notes (According to Official GATE 2017 Syllabus) GATE CS Corner See Placement Course for placement preparation, GATE Corner for GATE CS Preparation and Quiz Corner for all Quizzes on

To fix this you need to change the declarations of classes C and B to be virtual, as follows: class C: virtual public D { }; class B: virtual public D Second it really doesn't matter much if you could not answer few questions but it matters that whatever you answered, you must have answered with confidence. What is the purpose of ‘delete’ operator? ‘delete’ operator is used to release the dynamic memory which was created using ‘new’ operator. Check This Out How to solve C++ Programming problems?

In the dynamic memory allocation, the amount of memory allocated is not known beforehead. They are not declared within a function. Member Forums Join your peers in our member forums and ask questions from the real experts - topcoder members! cout << 25u - 50; View the answer →The answer is not -25.

Lippman, Josee Lajoie, Barbara E. What is abstraction? The default is optional in case of switch..case construct.Question : What is the difference between while and do-while loop? What is a reference variable in C++?

Jobs SENDFiles Whiteboard Net Meeting Tools Articles Facebook Google+ Twitter Linkedin YouTube Home Tutorials Library Coding Ground Tutor Connect Videos Search C++ Basics C++ Home C++ Overview C++ Environment Setup C++ case construct. Question : In control structure switch-case what is the purpose of default in C++ ? The default no-parameters constructor will not be generated if the class has at least one constructor with parameters declared and defined.

No, it’s a class from STL (Standard template library). A static member variable can be referred using the class name itself. Call by address: We send address of the actual parameters instead of values.