Home > Backend Development > C++ > C language limitations

C language limitations

WBOY
Release: 2023-09-14 19:33:02
forward
1487 people have browsed it

C language limitations

Question

What are the limitations of C language compared to other programming languages?

Solution

  • The C language blocks or prohibits concepts from object-oriented programming languages ​​such as inheritance, polymorphism, encapsulation, and data abstraction.

  • The C programming language does not do error checking on every line of code, it checks for errors after completing the entire coding.

  • It does not have the namespace attribute.

  • C programming is insufficient in data abstraction, that is, it does not have very large data processing capabilities.

  • C language does not allow users to detect errors through exception handling functions.

  • C language does not support the concepts of constructors and destructors.

  • Compared to other programming languages, it does not fully support solving real-world problems.

  • It is less secure compared to other programming languages.

Basic Structure

The following is the general structure of a "C" program:

/* documentation section */
preprocessor directives
global declaration
main ( ){
   local declaration
   executable statements
}
return type function name (argument list){
   local declaration
   executable statements
}
Copy after login

Example

/* Author : Tutorialspoint
Aim : Program for finding circumference of circle*/
#include<stdio.h>
#include<conio.h>
#define PI 3.1415
main ( ){
   float c, r;
   clrscr ( );
   printf ("enter radius of circle");
   scanf ("%f", &r);
   c = 2 * PI * r;
   printf ("Circumference = %f", c);
   getch ( );
}
Copy after login

Output

Enter radius of circle r=4
Circumference of circle c=25.132000
Copy after login

The above is the detailed content of C language limitations. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template