Difference between C and Ansi C

Key difference: C was originally developed by Dennis Ritchie at AT&T Bell Labs between 1969 and 1973. It has a free-format program source code. C is a general-purpose programming language. C is one of the oldest currently used programming languages and is one of the most widely used programming languages. ANSI C is a set of successive standards which were published by the American National Standards Institute (ANSI) for the C programming language. The ANSI specifies the syntax and semantics of programs written in C.

C was originally developed by Dennis Ritchie at AT&T Bell Labs between 1969 and 1973. It has a free-format program source code. C is a general-purpose programming language that uses semicolon (;) as a statement terminator, as well as curly braces ({}) for grouping blocks of statements.  It has facilities for structured programming and its design provides constructs that can map efficiently to typical machine instructions.  It also allows lexical variable scope and recursion and has a static type system, which prevents many unintended operations.

C is one of the oldest currently used programming languages and is one of the most widely used programming languages. It has been constantly used in applications that had previously coded in assembly language. This includes the UNIX computer operating system.

C has directly or indirectly influenced a lot of the later programming languages, such as C#, D, Go, Java, JavaScript, Limbo, LPC, Perl, PHP, Python, and Unix's C shell. Despite all these new languages, C still remains a popular programming language.

After the development of C, it got really popular and practically became the default programming language. However, it was not working the same on various different platforms. C had been designed for the UNIX environment; hence, when run in many other platforms, some codes were returning errors. There was a need for a set of standards, which would allow the C programming language to work similarly on all platforms. Hence, the ANSI C was born.

ANSI C is a set of successive standards which were published by the American National Standards Institute (ANSI) for the C programming language. The ANSI specifies the syntax and semantics of programs written in C. It also specifies the C program's interactions with the platform via input and output data. Additionally, it also specifies restrictions and limits imposed upon conforming implementations of C language translators.

The set of standards eventually developed into a second version of C which allowed the code to execute and perform as expected in various different environments. It was originally published by ANSI in 1988. The standards were eventually adopted by International Organization for Standardization (ISO) as their set of standards for C. Subsequent standards and revisions released by ISO have then been adopted by ANSI. Hence, ANSI C is also commonly referred to as ISO C, or the more generic Standard C.

Some differences between C and ANSI C:

  • ANSI C allows the inclusion of a function prototype which gives the type of the function and the type of each parameter before defining the function.
  • In C, function declarations are assumed by default to be of type int. Hence, integer type functions need not declared at all.
  • In C, function headers have different syntax.
  • Function prototypes must be declared without a list of arguments and types, and consist of the type, function name and an empty set of parentheses.
  • C converts all float types in an expression to double precision types.
  • The type signed char is not available in C, but is in ANSI C.
  • In C, type void is not available.
  • In C, functions are assumed to return integer if they return nothing.
  • Many old C compilers expect that the first character of a preprocessor directive line is a #. No leading white space is allowed.
  • In C, the signed type qualifier is not available.
  • In C, the unsigned qualifier can be used to qualify integer types only.
  • In C, the unary positive sign is not allowed.
  • In C, the type long double is not available.
  • In C, the const qualifier is not available.
  • In C, enumeration type is not available.
  • Automatic arrays cannot be initialized in declarations in C. Only external and static arrays can be initialized.
  • Automatic structures and arrays of structures cannot be initialized in declarations in C.
  • In C, Some old compilers may not allow references to entire structures, requiring the use of structure pointers or individual structure members.

Image Courtesy: gointerviews.com, it.emcelettronica.com

Most Searched in Environment Most Searched in Cars and Transportation
Most Searched in Health Most Searched in Education and References
Secularism vs Atheism
Whiskey vs Brandy
Toaster vs Toaster Oven
Nokia Lumia 720 vs Karbonn Titanium S5

Comments

Thankyou:)

Add new comment

Plain text

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.