Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between C and C++ [closed]

Tags:

c++

c

I know that C++ has the concept of objects but C doesn't. I also know that pretty much all there is to know about C fits into K & R but the C++ library is vastly more complex. There have got to be other big differences though.

What are the major differences between C and C++?

like image 637
Dinah Avatar asked Mar 12 '09 21:03

Dinah


People also ask

Is Objective C close to C?

Syntactically, Objective-C is an extension of C. So, some portion of Objective-C is exactly the same as C. Your experience of C would help learning such aspect of Objective-C. But the core part of Objective-C programming is made of Object Oriented class system, which you cannot find in C.

Is C Sharp close to C?

C# is a C-based language, so it makes the two syntaxes similar. The developer uses brackets to segment coding structures, and the C-style object-oriented code that includes dependencies and libraries are very similar. If the coder is familiar with Java or C++, it's very easy to move on to C#.

Is C and C hash same?

In c#, pointers are used only in unsafe mode. 1. C language supports procedural programming. Whereas C# supports object oriented programming.

Which is better C or C++?

Compared to C, C++ has significantly more libraries and functions to use. If you're working with complex software, C++ is a better fit because you have more libraries to rely on. Thinking practically, having knowledge of C++ is often a requirement for a variety of programming roles.


2 Answers

The C++ language says they are the same:

int C = 0;
assert(C++ == C);
like image 97
Brian R. Bondy Avatar answered Oct 09 '22 06:10

Brian R. Bondy


Check out Stroustrup's FAQ here, specifically:

What is the difference between C and C++?

C++ is a direct descendant of C that retains almost all of C as a subset. C++ provides stronger type checking than C and directly supports a wider range of programming styles than C. C++ is "a better C" in the sense that it supports the styles of programming done using C with better type checking and more notational support (without loss of efficiency). In the same sense, ANSI C is a better C than K&R C. In addition, C++ supports data abstraction, object-oriented programming, and generic programming (see The C++ Programming Language (3rd Edition)"; Appendix B discussing compatibility issues is available for downloading).

like image 22
Andy Mikula Avatar answered Oct 09 '22 07:10

Andy Mikula