+ 6
What is the difference between c and c ++
6 odpowiedzi
+ 6
C and C++ are two different computer programming languages. C++ was developed from the C programming language; however they are quite different in nature. The most obvious difference is that C is a procedure oriented language, whereas C++ supports both procedural and object oriented programming, therefore it is often called a hybrid language.
Difference between C and C++
C is a structural or procedural programming language But C++ is an object oriented programming language.
Emphasis is on procedure or steps to solve any problem and Emphasis is on objects rather than procedure.
Functions are the fundamental building blocks but Objects are the fundamental building blocks
C uses scanf() and printf() function for standard input and output but C++ uses cin>> and cout<< for standard input and output.
C is a middle level language and C++ is a high level language.
C program file is saved with .C extension but C++ program file is saved with .CPP extension.
I think I've cleared all Confusion 😅
+ 10
Both have tutorials here that you can follow and find the differences.
+ 5
C++ is like a superset of C.
They have the same syntax, code structure, but C++ has more added features like OOP or exception handling.
Why did you share this random code?
+ 3
Well, C++ was originally called “C with Classes” so that’s a good place to start. The main difference between C and C++ is that C++ has classes. This means that C is a procedural programming language, while C++ is an object-oritented programming language. Another great addition to C++ is the Standard Template Library (STL), which includes lots of useful functions and classes like std::sort, std::string, or std::vector.
While the original goal of C++ was to simply implement classes in the C language, it has slowly expanded, adding tons of new features. Very few people now choose to use C over C++. because of this, the C language has hardly changed over the past decades, as it is mostly now used for legacy code. However, the C++ language is always changing. New features like initilizer lists or constexpr are far beyond the original scope of the “C with Classes” project.
It is important to relize however, that C++ is 100% backwards-compatible with C. That is, if a code snippet compiles in C, it will also compile in C++. This is useful because it allows developers to focus on developing new software instead of worring about their legacy C code becoming obsolete.
+ 2
Kucho nahi bhai
💯💯💯💯
0
Thanks