difference between c and c++?

Answers were Sorted based on User's Feedback



difference between c and c++?..

Answer / pragati paliwal

1.c is procedure oriented lang. while c++ is object oriented lang.
2. in c data security is less because all function shares global data,while in c++ data security is most because of binding of data with function in a single unit called class.This feature of c++ is called encapsulation.
3.c does not deal with real world problems properly.eg. maintaining a database. while c++ deals with real world problems.
4.in c if we need to change the data structure then we have to change the coding of all the functions which are using that data,while in c++ if we need to change the data structure change only data structure of those functions which are binded with that data.

Is This Answer Correct ?    14 Yes 0 No

difference between c and c++?..

Answer / tiony

Guys the following page, may help you to find out some
important differences between them...

http://hubpages.com/hub/Differences-between-C-and-Cplusplus

Is This Answer Correct ?    14 Yes 4 No

difference between c and c++?..

Answer / muhammad asim

1.C language is easy as compare to c++.Because in one side
c++ show inheritance so another side its show the
properties of encapslution which are the contrast or weaken
point to inheritance due to encapslution.
2.In C the function pass from one funtion to another
several times while in C++ the function is hidden through
some external function.
3.C is a procedural or structural oriented language uses
ups-down approch and focus on procedure rather than data
while C++ is an object-oriented language uses down-ups
approch and focus on data rather than procedure.
4.C language uses pointer concept while there is no concept
of pointer in C++.
5.C++ is a prototype or a strick typechecking where C is
free of such things, so most programmes which is compiled
by C compiler cannot be compiled by C++ compiler.

Is This Answer Correct ?    13 Yes 5 No

difference between c and c++?..

Answer / k.k

.............SOME DIFFERENT ANSWER......

1) In c we declare variable at the start of block...

In c++ we can declare it any where.....

2)In c we can change value of constant variable by using
pointer...
In c++ we can not....

3)In c we can not take the address of register variable..

In c++ we can...

register int x;
printf("%d",&x);

Is This Answer Correct ?    7 Yes 0 No

difference between c and c++?..

Answer / radha garg

hi,
for more understanding see this program

for adding two no.

#include<stdio.h>................#include<iostream.h>
#include<conio.h> . #include<conio.h>
void main() . void main()
{ . {
int a,b,c; . int a,b;
printf("enter 2 no."); . cout<<"enter two number";
scanf("%d%d",&a,&b); . cin>>a>>b;
c=a+b; . int c=a+b;
printf("sum is=%d"c); . cout<<"sum is="<<c;
getch(); . getch
(); .
} . }

so from above we know that in c variables are declared in
above bt in case of C++ variable declaration can be
anywhere .whenever we need we declare variables

Is This Answer Correct ?    8 Yes 1 No

difference between c and c++?..

Answer / shilpa

c is procedure oriented language and gives importance to
procedure that is functions rather than data.c is middle
level language.
c++ is object oriented language and gives importance to
object that is data
c++ is high level language

Is This Answer Correct ?    10 Yes 4 No

difference between c and c++?..

Answer / swapna adusumilli

c is procedure oriented language. In c first we have to
declare methods and call those methods in main(). After that
we have to implement those methods.
c is middle level language.
c++ is object oriented language and gives importance to
object that is data. Here first we have to implement
methods, after that we call those methods in main().
c++ is high level language

Is This Answer Correct ?    8 Yes 4 No

difference between c and c++?..

Answer / tania

In c++,access specifiers(public,protected,private)are used
while in C they are not used because in c there isn't any
data accessing restriction.
In c,I/O functions are scanf(),printf()respectively,but in
C++ cin>>,cout<< are used respectively.

Is This Answer Correct ?    3 Yes 0 No

difference between c and c++?..

Answer / nagalaxmi thumma

-> C is a Procedure language where as C++ is object-oriented
language.

->C is Low Level language where as C++ is High Level Language.

->C is Top-Down Approach where as C++ is Bottom-up Approach.

->C++ accept all the feature & function of of C and its own
properties,but C doesn't accept all features & Functions of C++.

->C gives importance to the Functions and Procedures where
as C++ gives importance to the Objects.

Is This Answer Correct ?    3 Yes 0 No

difference between c and c++?..

Answer / ks

/// <summary>
/// This function GetDetailById has been made to show
the Qualification details in grid view on the page
/// when the Admin enter any StudentId and clicks on
Submit button.
/// </summary>
/// <param name="studentid"></param>
/// <returns></returns>
public DataSet GetDetailById(int studentid)
{
con.Close();
con.Open();
cmd = new SqlCommand("sp_VIEWINFO", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@studentid",studentid);
adap = new SqlDataAdapter(cmd);
adap.Fill(ds,"TBL_STUDENTQUALIFICATION");
return ds;
}

/// <summary>
/// This function GetPersonalInfoById has been made to
show the Personal details in grid view on the page
/// when the Admin enter any StudentId and clicks on
Submit button.
/// </summary>
/// <param name="studentid"></param>
/// <returns></returns>
public DataSet GetPersonalInfoById(int studentid)
{
con.Close();
con.Open();
cmd = new SqlCommand("sp_PERSONALINFO", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@studentid",studentid);
adap = new SqlDataAdapter(cmd);
adap.Fill(ds,"TBL_STUDENTDETAIL");
return ds;
}

/// <summary>
/// This function GetCourseInfoById has been made to
show the Course details on the page when the Admin enters
/// any StudentId and clicks on Submit button.
/// </summary>
/// <param name="studentid"></param>
/// <returns></returns>
public SqlDataReader GetCourseInfoById(int studentid)
{
con.Close();
con.Open();
cmd = new SqlCommand("sp_GETCOURSEINFO", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue
("@studentid",studentid);
rd = cmd.ExecuteReader();
return rd;
}

/// <summary>
/// This function InsertPaymentDetail has been made to
insert the details of Payment into the Database.
/// </summary>
/// <param name="studentid">Unique Id of the
student</param>
/// <param name="paymode">Mode of Payment</param>
/// <param name="amount">Amount that has been
paid</param>
/// <param name="ddraftno">DD or Cheque No if payment
is not in cash</param>
/// <param name="bankname">Name of the Bank</param>
/// <returns></returns>
public int InsertPaymentDetail(int studentid,string
admitdate, string paymode,string amount,string
ddraftno,string bankname,string courseapply)
{
con.Close();
con.Open();
cmd = new SqlCommand("sp_PAYDETAIL",con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@studentid",studentid);
cmd.Parameters.AddWithValue("@admitdate",admitdate);
cmd.Parameters.AddWithValue("@paymode",paymode) ;
cmd.Parameters.AddWithValue("@amount",amount);
cmd.Parameters.AddWithValue("@ddno",ddraftno);
cmd.Parameters.AddWithValue("@bankname",bankname);
cmd.Parameters.AddWithValue
("@courseapply",courseapply);
int temp = cmd.ExecuteNonQuery();
return temp;
}

/// <summary>
/// This function ShowPaymentDetail shows the
ReceiptNo,Course name,Amount in the FeeReceipt page
/// </summary>
/// <param name="studentid">Unique Id of the
student</param>
/// <returns></returns>
public DataSet ShowPaymentDetail(int studentid)
{
con.Close();
con.Open();
cmd = new SqlCommand("sp_SHOWRECEIPTINFO",con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@studentid",studentid);
adap = new SqlDataAdapter(cmd);
adap.Fill(ds,"TBL_PAYMENT");
return ds;
}

/// <summary>
/// This function ShowPersonalPaymentDetail has been
made to display First Name,Last Name in the FeeReceipt Page
/// </summary>
/// <param name="studentid">Unique Id of student</param>
/// <returns></returns>
public DataSet ShowPersonalPaymentDetail(int studentid)
{
con.Close();
con.Open();
cmd = new SqlCommand("sp_SHOWRECEIPT", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@studentid",
studentid);
adap = new SqlDataAdapter(cmd);
adap.Fill(ds,"TBL_STUDENTDETAIL");
return ds;
}

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C++ General Interview Questions

What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero

0 Answers  


Explain the different access specifiers for the class member in c++.

0 Answers  


How would you call C functions from C++ and vice versa?

0 Answers   Genpact,


the first character in the variable name must be an a) special symbol b) number c) alphabet

0 Answers  


Explain virtual class?

0 Answers  






How would you use qsort() function to sort an array of structures?

0 Answers  


What is the role of static keyword for a class member variable?

0 Answers  


Why preincrement operator is faster than postincrement?

5 Answers  


Please post the model question paper of hal?

2 Answers  


What is Virtual Inheritance?

7 Answers   Amazon, Wipro,


Write a C++ Program to Multiply two Numbers

1 Answers  


what are Operators and explain with an example?

0 Answers  


Categories