Posted By:
9 Feb, 2014 1:21 am PST

Advantages of C

Advantage and Disadvantage of C over C++:


This language was designed by top notch hackers for their own use. It was designed to help them write Operating Systems, Compilers and other system tools.

It provides excellent performance and allows low level hardware access.

Advantages of C:

1.       It is older when compared to C++ and Java, thus it has many tutorials, and libraries.


2.       It is very powerful language.


3.       It is fastest of the three languages (C, C++, and Java).

                  -  Newer languages support Garbage Collection, Dynamic Typing etc., which leads to an overhead during compilation, thus result in some extra time. All the advanced features are absent is C, which doesn’t add any overhead during the compile time.


4.       C code can be coded in C++ compilers.

- As C++ is an extended version of C, it also supports the execution of C programs.


5.       It provides low level access to computer memory using pointers concept.


6.       Interpreters are not required.


7.       It is a simple core language, and libraries add functionality to this language.

Disadvantages of C:

1.       Data is not secured, as Object Oriented features are absent.

-Object oriented features such as Data Hiding are absent in C.


2.       C does not support Function Overloading.

-Two functions having the same name in the same program is called Function Overloading. An Object oriented feature in C++, Polymorphism, helps C++ achieve this.


3.       We cannot use functions inside structures in C.

- In C, a structure is only for storing data: a function is not data, so it cannot be stored into a structure.


4.       NAMESPACE feature is absent in C.

-          No two names can be same. Two students belonging to the same school cannot have same Registration Number whereas two students from different schools can have same registration numbers. Here schools are the namespaces and thus have same identifiers (registration number).



5.       C doesn’t allow the use of reference variables.

-In C++ we can use reference variable which allow two variable names to point to the same memory location. C doesn’t support that.


6.       Code can be damaged easily.


Differences between C and Java:


Basically designed for handheld devices and set top boxes, Java found its way beyond that. It is now used to program almost everything that we use. Sun Microsystems developed Java Programming languages.


1.       Java is Object oriented while C is procedural.


2.       Java is High level language, while C is a low Level language.

-We can use C language to directly communicate with the system hardware, which is not the case with Java.


3.       We use references for objects instead of using Pointers.

- In Java we use reference variable which allow two variable names to point to the same memory location. C doesn’t support that.


4.       Java supports method overloading.

-We can have more than one method with same name but different operations in the same program.


5.       Exception Handling is used in java, which makes the code reliable.

-If any error is present in the code, it can be handled without the code being interrupted in between.


6.       It has an extensive class library.

7.       Java doesn’t support the use of preprocessors.

-          C uses preprocessors because, preprocessors are used for including platform conditional code. Java is meant to be “Write once and use anywhere “so, Java doesn’t use preprocessors.

Please login to reply to this problem.