What are advantages of C++ when comparing with C?




Answers were Sorted based on User's Feedback



What are advantages of C++ when comparing with C?..

Answer / hari krishna pillai

Well!! This will results long and very long answer or
discussion. To make it short, C++ is a general purpose
programming language with a bias towards systems
programming that It is a better C, supports Data
Abstraction, supports Object Oriented Programming and
Generic Programming.

Is This Answer Correct ?    49 Yes 8 No

What are advantages of C++ when comparing with C?..

Answer / reegan

data security,data encapsulation,reusability

Is This Answer Correct ?    39 Yes 9 No

What are advantages of C++ when comparing with C?..

Answer / atreyee

A program in C is unstable compared 2 C++
Encapsulation,Inheritance in C++.

Is This Answer Correct ?    28 Yes 10 No




What are advantages of C++ when comparing with C?..

Answer / mohana

stonger typing: the type system in c++ is stronger than in c

Is This Answer Correct ?    24 Yes 10 No

What are advantages of C++ when comparing with C?..

Answer / a geek

We can not compare C to C++.
C++ programming is object oriented and and lot of features
which are no way achievable in C easily.

Is This Answer Correct ?    20 Yes 6 No

What are advantages of C++ when comparing with C?..

Answer / shami

C++ IS A NEW VERSION OF C,WHICH ACHEIVES EASY WAY OF
PROGRAMING USING OO APPROACH.

Is This Answer Correct ?    16 Yes 6 No

What are advantages of C++ when comparing with C?..

Answer / bhuvana

C++ is an object oriented programming language.And it has
the main features of classes & objects, inheritances,
polymorphism.

Is This Answer Correct ?    12 Yes 4 No

What are advantages of C++ when comparing with C?..

Answer / hari prasanth

c is a computer programming language and c++ is a object
oriented programming language

Is This Answer Correct ?    11 Yes 3 No

What are advantages of C++ when comparing with C?..

Answer / swathi

c++ is an extension of c with some additional features like encapsulation,inheritance,etc. which makes the program to easily understand

Is This Answer Correct ?    1 Yes 0 No

What are advantages of C++ when comparing with C?..

Answer / k

c


















c++ is object oriented program. the main advatage is we can reuse the code and well structured and secured...
c

Is This Answer Correct ?    1 Yes 0 No

Post New Answer



More C++ General Interview Questions

How to write Multithreaded applications using C++?

2 Answers   TCS, Wipro, Honeywell,


Explain the need for "Virtual Destructor"?

2 Answers   Infosys,


what is scupper?

0 Answers  


How many bit combinations are there in a byte?

13 Answers   Intel, Microsoft,


how can i access a direct (absolute, not the offset) memory address? here is what i tried: wrote a program that ask's for an address from the user, creates a FAR pointer to that adress and shows it. then the user can increment/decrement the value in that address by pressing p(inc+) and m(dec-). NOW, i compiled that program and opened it twice (in 2 different windows) and gave twice the same address to it. now look what happen - if i change the value in one "window" of the program, it DOES NOT change in the other! even if they point to the same address in the memory! here is the code snippet: //------------------------------------------------------ #include <stdio.h> //INCLUDE EVERY KNOWN HEADER FILE #include <conio.h> //FOR ANY CASE... #include <iostream.h> #include <dos.h> #include <process.h> main() { int far *ptr; //FAR POINTER!!! long address; char key=0; //A KEY FROM THE KEYBOARD int temp=0; clrscr(); cout<<"Enter Address:"; cin>>hex>>address; //GETS THE ADDRESS clrscr(); (long)ptr=address; temp=*ptr; //PUTS THE ADDRESS IN THE PTR cout<<"["<<hex<<(unsigned long)ptr<<"]="<<*ptr<<" = "<< (char)(*ptr); //SHOWS: [address]=value=ASCII symbol. while (key!=27) //WHILE YOU DONT PRESS ESC. { while(!kbhit()) //WHILE KEY IS NOT PRESSED { if (temp!=*ptr) { temp=*ptr; clrscr(); cout<<"["<<hex<< (unsigned long)ptr<<"]="<<*ptr<<" = "<<(char)(*ptr); }; //IF THE VALUE HAS CHANGED, CLEAR THE SCREEN AND SHOW //AGAIN if (key=='p') {key=0; (*ptr)++; } //INCREMENT VALUE if (key=='m') {key=0; (*ptr)--; } //DEC. VALUE }; key=getch(); //IF A KEY IS PRESSED, READ IT FROM THE //KEYBOARD }; return 0; //IF ESC WAS THE KEY, EXIT THE PROGRAM } //---------------------------------------------------------

0 Answers  






Ask to write virtual base class code?

0 Answers   Satyam,


Board Coloring Problem Description In this problem you are given a board in which some of the elements are placed as shown in diagram below. Each element represents a color. Fill the other elements in the board, such that none of the adjacent elements (vertically, horizontally and diagonally) should be of the same color. Find out the minimum number of colors that should be used to fill the blank spaces in the board, so that the above condition is met. Color representation is -: 0, 1, 2, 3, 4, 5, 6, 7……………………. There is sample board: For Example: Given Board : Matrix representation of board is : [ _ 1 _ _ ] [ 2 _ _ _ ] [ _ _ 2 _ ] [ 2 _ _ _ ] here blank space is represented by '_' . Minimum colors to fill this board (given in the picture)is 4. Instruction to work with Open PBT Client: Specify the work directory path in the 'Work directory Path' field. The path should correspond to your solution Work directory. Download the support files by clicking the Get Dev Files. You will find the problem directories containing: problem.h file problem.c file in your project directory. Code the solution in.c file inside the problem directory All required files will be downloaded to your work directory. Creating additional files is strongly discouraged. Step 1: In your Solution File: Implement your logic in function int color(char board[4][4]) char board[4][4]board is 2 dimensional matrix of order M X M where M = 4. You can create more functions if required, but those functions should be in the same file. Step 2: In your solution keep in mind the following constraints. In this problem you have to write a program that finds the minimum number of colors needed to fill a board in which some of the elements are placed in advance. Function color() will take 2 dimension board as a input. Function color() returns the minimum number of colors that could fill the board meeting the given condition. Board is a 2 dimensional of M X M where M = 4 else return 0 Fill the other elements in the board, such that none of the adjacent elements (vertically, horizontally and diagonally) should be of the same color. The Prototype of the function is int color(char board[4][4]) This function takes following arguments. board is 2 dimensional matrix of order M X M where M = 4. This function returns minimum no of color by which board can be filled. The constraints are: Board is a 2 dimensional of M X M where M = 4 else return 0 Fill the other elements in the board, such that none of the adjacent elements (vertically, horizontally and diagonally) should be of the same color. Example 1 Input { 2 0 _ 1 } { _ 1 _ _ } { _ 2 _ 0 } { _ _ _ 1 } Output 5 Explanation: We need a minimum 5 different colors to complete the board. Example 2 Input { 2 0 _ 1 3} { _ 1 _ _ 2} { _ 2 _ 0 1} { _ _ _ 1 2} { _ _ _ _ 0} Output 0 Explanation: Size of the board is greater than 4X4. Example 3 Input { _ 0 } { 1 _ } Output 0 Explanation: Size of the board is less than 4X4. For C solutions Header File : boardcoloring.h Function Name : int color(char board1[4][4]) File Name : boardcoloring.c For C++ solutions Header File : boardcoloring.h Class Name : BoardColoring Function Name : int color(char board1[4][4]) File Name : boardcoloring.c

0 Answers   Infosys,


Perform addition, multiplication, subtraction of 2-D array using Operator Overloading.

0 Answers   TCS, Nucleus,


Write a program to calculate the following i want a c++program for this condition 1+4+9+16+….+100 Like this (1^2+2^2) Hint use function pow(a,b)

4 Answers   TCS, HTC,


write program for palindrome

81 Answers   Syntel, Aricent, Amazon, HCL, Temenos, GE, CSC, Wipro, Infosys,


In inline " expression passed as argument are evalauated once " while in macro "in some cases expression passed as argument are evaluated more than once " --> i am not getting it plz help to make me understand....

0 Answers   CS, College School Exams Tests,


Write a corrected statement in c++ so that the statement will work properly. x =+ 7;

2 Answers  






Categories