difference between c and c++?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
What is the difference between global int and static int declaration?
Design a program to input a date from user in the form day/month/year (e.g. 2/6/2000) and report whether it’s a valid date or not. The program should take account of leap years. You will need to know that a leap year is a year that is exactly divisible by 4, except that century years are only leap years if they are divisible by 400.
What is the use of seekg in c++?
Explain the difference between struct and class in terms of access modifier.
Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?
Can there be at least some solution to determine the number of arguments passed to a variable argument list function?
what is the behaviour of C and C++ compiler for the below statements. int *p; p = malloc(100); Is the behaviour same ? or different ?
What is c++ map?
How do you allocate and deallocate memory in C++?
explain the reference variable in c++?
Is facebook written in c++?
Write about the role of c++ in the tradeoff of safety vs. Usability?