Home  >  Article  >  Backend Development  >  C language limitations

C language limitations

WBOY
WBOYforward
2023-09-14 19:33:021425browse

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
}

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 ( );
}

Output

Enter radius of circle r=4
Circumference of circle c=25.132000

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

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete