C++ General Interview Questions
Questions Answers Views Company eMail

Find the second maximum in an array?

HCL,

12 22380

"How will you merge these two arrays? Write the program Array: A 1 18 22 43 Array: B 3 4 6 20 34 46 55 Output Array: C 1 3 4 6 18 20 22 34 43 46 55"

College School Exams Tests, HCL,

9 21995

What is Object Oriented programming.what is the difference between C++ and C?

Infosys,

8 22774

Memory is not a constraint. In a single iteration(NOTE: you can't go back), how will you find out the 10th last node/item in a linked list.

BNB, FDS, Goldman Sachs, Nagarro,

16 22889

how to swap two numbers with out using temp variable

Global eProcure, TCS,

12 17506

Can we use resume in error handling i.e. in the catch block

Infosys,

5 8432

this is to swap to strings....but in output the whole strings are swapped leaving first as it is...why it is so #include int main() { char a[]="ajeet"; char b[]="singh"; long x=*a; long y=*b; cout< 1 3862


how to swap two strings without using any third variable ?

11 36198

if i want cin 12345678910 and cout abcdefghij. so how can i create the program?. example : if i key in 8910 so the answer is ghij.

3 4945

Write a program that read 2o numbers in and array and output the second largest number. Can anybody help??

7 8843

In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest.

GE,

5 6563

Consider a c++ template funtion template T& Add(T a, T b){return a+b ;} if this function is called as T c = Add("SAM", "SUNG"); what will happen? What is the problem in the template declaration/ How to solve the problem.

LG, Samsung,

7 14800

Disadvantages of c++

HCL,

8 15755

what is the size of this class class size { public: char data1; double d; int data2; char data3; double data4; short data5; }; please explain the padding for these double variables.

9 8973

Please post the model question paper of hal?

2 3918


Post New C++ General Questions

Un-Answered Questions { C++ General }

Explain Text Manipulation Routines?

632


What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass

669


What is Destructor in C++?

630


What is code reusability in c++?

658


What is the use of data hiding?

585






Please explain class & object in c++?

594


Define namespace in c++?

641


Explain function overloading

576


What are files in c++?

583


What are the two main components of c++?

578


What is size of string in c++?

544


Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work

595


How do you compile the source code with your compiler?

603


Which operations are permitted on pointers?

556


How do you flush a buffer in c++?

592