What is the difference between C and ANSI C?

This question is related to Wipro Interview

Showing Answers 1 - 9 of 9 Answers

c refers to traditional c developed by dennis ritchie at bell laboratories around 1972 or so, he did it  for unix ofcource.then later problems occured wen c was transplanted to other oses and also ther occured a need to stansardize c ,so the standardizing giant did it and came up with ansi c..which most of us use now.

one easy way to differentiate c and ansi c is using

#if  __STDC__ in your program .__STDC__ is defined in ANSI c by default were its not the case with traditional c .There do exist many other differences.but i think this is inly needed for the time being.

thankks

Raman Nv

  • Aug 9th, 2014
 

According to "The C Programming Language" by Dennis Ritchie and Brian Kernighan,

The biggest change between ANSI C and earlier versions is how functions are declared and defined. In the original definition of C, the power function would have been written like this:

Code
  1.  

  2. power(base, n)

  3. int base, n;

  4. {

  5.    //Function code

  6. }

  7.  

  8.  

  9. //and in ANSI C, the same function would look like:

  10.  

  11. int power(int base, int n)

  12. {

  13.     //Code

  14. }

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions