SlideShare a Scribd company logo
1 of 20
C language Myth & Secrets.
By,
Ankush Mundhra
BCA II year
Contents
 Introduction
 History of C
• Its early development
• K&R C
• C language standards
 Myths & Secrets
 Experiment
 Q & A
Introduction
 What is C language ?
 C is a high-level and general purpose programming
language that is ideal for developing firmware or
portable applications. Originally intended for writing
system software, C was developed at Bell Labs by
Dennis Ritchie for the Unix Operating System (OS) in
the early 1970s.
of C language -
 Simple
 Portability
 Powerful
 Case sensitive
 Modularity
 Use of Pointers
History of C language
 Its early developments -
 C language was invented for implementing
UNIX operating system.
 The C programming language is a structure
oriented programming language,
developed at Bell Laboratories in 1972 by
Dennis Ritchie.
 C programming language features were
derived from an earlier language called
“B” (Basic Combined Programming
Language – BCPL).
Ken Thompson & Dennis Ritchie
 K&R C -
In 1978, Brian Kernighan and Dennis Ritchie published the
first edition of ”The C Programming Language”. This
book, known to C programmers as "K&R", served for many
years as an informal specification of the language.
K&R introduced several language features:
 Standard I/O library
 Long int data type
 Unsigned int data type
In the years following the publication of K&R C, several
features were added to the language, supported by
compilers from AT&T and some other vendors. These
included:
 Void functions
 Assignment for struct data types
 Enumerated types
 Functions returning struct or union types
 C Language Standards -
• C89/C90 standard –
First standardized specification for C language was developed
by the American National Standards Institute in 1989. C89 and
C90 standards refer to the same programming language.
• C99 standard –
Next revision was published in 1999 that introduced new
features like advanced data types and other changes.
C11 AND EMBEDDED C LANGUAGE –
• C11 standard adds new features to C programming language
and library like type generic macros, anonymous structures,
improved Unicode support, atomic operations, multi-
threading and bounds-checked functions. It also makes some
portions of the existing C99 library optional and improves
compatibility with C++.
• Embedded C includes features not available in C like fixed-
point arithmetic, named address spaces, and basic I/O
hardware addressing.
• Operating systems, C compiler and all UNIX application
programs are written in C language
• It is also called as procedure oriented programming language.
The C language is reliable, simple and easy to use. C has been
coded in assembly language.
Myths & Secrets
“ C is quirky, flawed, and an enormous success.”
- Dennis Ritchie
1) C is obsolete.
No one uses C anymore!
It is true that C is the Latin of programming
languages and that recent languages are more
flexible and let us do amazing stuff with ease.
However, most of these languages have emerged
from C. They have been built with C as their base.
2) C++ is better than C.
There are two versions of everything these days,
exactly like C and C++. C is like the 5-inch version
of a smartphone and C++ is its 6-inch variant. Both
pack almost same features with a few
modifications here and there. Whatever you
achieve with C, you can achieve with C++.
Similarly, whatever you can make in C++, you can
also make that with C.
3) C++ is the next version of C!
People say C++ is the next version of C, which
technically it is NOT, not even close! The term
“version” comes into picture when we are dealing
with the same thing, for example, Windows 8,
Windows 8.1 and so on. In the case of C and C++,
they are two different languages. It’s true that
they are built on the same base, but they can’t
technically be called “versions” as such.
4) Arrays start at 0 rather than 1.
Most people start counting at 1, rather than zero. Compiler writers
start with zero because we're used to thinking in terms of offsets.
This is sometimes tough on non-compiler-writers; although a[100]
appears in the definition of an array, we would better not store any
data at a[100], since a[0] to a[99] is the extent of the array.
5) No nested functions.
Function contained inside another function is known
as nested function. This simplifies the
compiler and slightly speeds up the runtime
organization of C programs.
Experiments
1) Difference in data types sizes in GCC and in Turbo
compiler.
Here is the code -
#include<stdio.h>
int main()
{
int *p;
printf("%dn", sizeof(int));
printf("%dn", sizeof(char));
printf("%dn", sizeof(float));
printf("%dn", sizeof(double));
printf("%dn", sizeof(p));
return 0;
}
After Compiling the above code,
Here is the output -
GCC Compiler Turbo C Compiler
2. Difference in output in Increment Decrement operator.
Here is the code -
#include<stdio.h>
int main()
{
int i=5;
printf("%d%d%d%d%d",i++,i--,++i,--i,i);
return 0;
}
After Compiling the above code,
Here is the output -
GCC Compiler Turbo C Compiler
Reference
 Wikipedia
 Google
 Quora
 Arihant All-in-One Computer Science book
 Bibhudendu Panda Sir
C language myths & secrets
C language myths & secrets

More Related Content

What's hot

Introduction to c language | History of C language
Introduction to c language | History of C languageIntroduction to c language | History of C language
Introduction to c language | History of C languagesimplidigital
 
Lecture 2 history_of_c
Lecture 2 history_of_cLecture 2 history_of_c
Lecture 2 history_of_ceShikshak
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingSivant Kolhe
 
C++ history session 00 history
C++ history session 00   historyC++ history session 00   history
C++ history session 00 historyArun Prakash
 
History of c programming language.
History of c programming language.History of c programming language.
History of c programming language.Md Khalid Hasan
 
Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C LanguageTarun Sharma
 
Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C LanguageKamal Acharya
 
C programming short notes by pulkit modi
C programming short notes by pulkit modiC programming short notes by pulkit modi
C programming short notes by pulkit modiPulkitmodi1998
 
C++ vs python the best ever comparison
C++ vs python the best ever comparison C++ vs python the best ever comparison
C++ vs python the best ever comparison calltutors
 
Doppl development iteration #10
Doppl development   iteration #10Doppl development   iteration #10
Doppl development iteration #10Diego Perini
 
C & C++ Training in Ambala ! BATRA COMPUTER CENTRE
C & C++ Training in Ambala ! BATRA COMPUTER CENTREC & C++ Training in Ambala ! BATRA COMPUTER CENTRE
C & C++ Training in Ambala ! BATRA COMPUTER CENTREjatin batra
 
1 introduction to c programming language
1 introduction to c programming language1 introduction to c programming language
1 introduction to c programming languageNarendra Soni
 
Introduction to c_language
Introduction to c_languageIntroduction to c_language
Introduction to c_languageWay2itech
 

What's hot (19)

Introduction to c language | History of C language
Introduction to c language | History of C languageIntroduction to c language | History of C language
Introduction to c language | History of C language
 
Lecture 2 history_of_c
Lecture 2 history_of_cLecture 2 history_of_c
Lecture 2 history_of_c
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
C Language
C LanguageC Language
C Language
 
C++ history session 00 history
C++ history session 00   historyC++ history session 00   history
C++ history session 00 history
 
History of c programming language.
History of c programming language.History of c programming language.
History of c programming language.
 
C++ language
C++ languageC++ language
C++ language
 
Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C Language
 
C++ vs python
C++ vs pythonC++ vs python
C++ vs python
 
Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C Language
 
Lecture # 1
Lecture # 1Lecture # 1
Lecture # 1
 
Python vs c++ ppt
Python vs c++ pptPython vs c++ ppt
Python vs c++ ppt
 
C Programming Language
C Programming LanguageC Programming Language
C Programming Language
 
C programming short notes by pulkit modi
C programming short notes by pulkit modiC programming short notes by pulkit modi
C programming short notes by pulkit modi
 
C++ vs python the best ever comparison
C++ vs python the best ever comparison C++ vs python the best ever comparison
C++ vs python the best ever comparison
 
Doppl development iteration #10
Doppl development   iteration #10Doppl development   iteration #10
Doppl development iteration #10
 
C & C++ Training in Ambala ! BATRA COMPUTER CENTRE
C & C++ Training in Ambala ! BATRA COMPUTER CENTREC & C++ Training in Ambala ! BATRA COMPUTER CENTRE
C & C++ Training in Ambala ! BATRA COMPUTER CENTRE
 
1 introduction to c programming language
1 introduction to c programming language1 introduction to c programming language
1 introduction to c programming language
 
Introduction to c_language
Introduction to c_languageIntroduction to c_language
Introduction to c_language
 

Similar to C language myths & secrets

C programming orientation
C programming orientationC programming orientation
C programming orientationnikshaikh786
 
C Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYC Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYRajeshkumar Reddy
 
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTREC & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTREjatin batra
 
Summer training PPT Manasv Singharia.pptx
Summer training PPT Manasv Singharia.pptxSummer training PPT Manasv Singharia.pptx
Summer training PPT Manasv Singharia.pptxshokeenk14
 
Why C is Called Structured Programming Language
Why C is Called Structured Programming LanguageWhy C is Called Structured Programming Language
Why C is Called Structured Programming LanguageSinbad Konick
 
C-PROGRAMMING-LANGUAGE.pptx
C-PROGRAMMING-LANGUAGE.pptxC-PROGRAMMING-LANGUAGE.pptx
C-PROGRAMMING-LANGUAGE.pptxDhirendraShahi2
 
Learn c programming language in 24 hours allfreebooks.tk
Learn c programming language in 24 hours   allfreebooks.tkLearn c programming language in 24 hours   allfreebooks.tk
Learn c programming language in 24 hours allfreebooks.tkragulasai
 
c programming, internshala training , govt engineering college aurangabad
c programming, internshala training , govt engineering college aurangabadc programming, internshala training , govt engineering college aurangabad
c programming, internshala training , govt engineering college aurangabadPysh1
 
20210417-cppRelevancy-DataStructures.pptx
20210417-cppRelevancy-DataStructures.pptx20210417-cppRelevancy-DataStructures.pptx
20210417-cppRelevancy-DataStructures.pptxSuman Garai
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming LanguageRamaBoya2
 
Best C Programming Training & Coaching in Ambala
Best C Programming Training & Coaching in AmbalaBest C Programming Training & Coaching in Ambala
Best C Programming Training & Coaching in Ambalajatin batra
 
Lecture 1-introduction to c
Lecture 1-introduction to cLecture 1-introduction to c
Lecture 1-introduction to cMuktadir Shoaib
 
Fundamentals of programming and problem solving
Fundamentals of programming and problem solvingFundamentals of programming and problem solving
Fundamentals of programming and problem solvingJustine Dela Serna
 
all languages in computer programming
all languages in computer programmingall languages in computer programming
all languages in computer programminghamza239523
 
Lecture01-Introduction-to-C-programming-converted (4).pptx
Lecture01-Introduction-to-C-programming-converted (4).pptxLecture01-Introduction-to-C-programming-converted (4).pptx
Lecture01-Introduction-to-C-programming-converted (4).pptxMdMuaz2
 

Similar to C language myths & secrets (20)

C programming orientation
C programming orientationC programming orientation
C programming orientation
 
C Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYC Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDY
 
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTREC & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
 
What is C.docx
What is C.docxWhat is C.docx
What is C.docx
 
Summer training PPT Manasv Singharia.pptx
Summer training PPT Manasv Singharia.pptxSummer training PPT Manasv Singharia.pptx
Summer training PPT Manasv Singharia.pptx
 
Why C is Called Structured Programming Language
Why C is Called Structured Programming LanguageWhy C is Called Structured Programming Language
Why C is Called Structured Programming Language
 
Ch1 Introducing C
Ch1 Introducing CCh1 Introducing C
Ch1 Introducing C
 
C-PROGRAMMING-LANGUAGE.pptx
C-PROGRAMMING-LANGUAGE.pptxC-PROGRAMMING-LANGUAGE.pptx
C-PROGRAMMING-LANGUAGE.pptx
 
c.pdf
c.pdfc.pdf
c.pdf
 
Learn c programming language in 24 hours allfreebooks.tk
Learn c programming language in 24 hours   allfreebooks.tkLearn c programming language in 24 hours   allfreebooks.tk
Learn c programming language in 24 hours allfreebooks.tk
 
c programming, internshala training , govt engineering college aurangabad
c programming, internshala training , govt engineering college aurangabadc programming, internshala training , govt engineering college aurangabad
c programming, internshala training , govt engineering college aurangabad
 
20210417-cppRelevancy-DataStructures.pptx
20210417-cppRelevancy-DataStructures.pptx20210417-cppRelevancy-DataStructures.pptx
20210417-cppRelevancy-DataStructures.pptx
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 
Best C Programming Training & Coaching in Ambala
Best C Programming Training & Coaching in AmbalaBest C Programming Training & Coaching in Ambala
Best C Programming Training & Coaching in Ambala
 
introduction to c
introduction to cintroduction to c
introduction to c
 
Lecture 1-introduction to c
Lecture 1-introduction to cLecture 1-introduction to c
Lecture 1-introduction to c
 
Fundamentals of programming and problem solving
Fundamentals of programming and problem solvingFundamentals of programming and problem solving
Fundamentals of programming and problem solving
 
all languages in computer programming
all languages in computer programmingall languages in computer programming
all languages in computer programming
 
Lecture01-Introduction-to-C-programming-converted (4).pptx
Lecture01-Introduction-to-C-programming-converted (4).pptxLecture01-Introduction-to-C-programming-converted (4).pptx
Lecture01-Introduction-to-C-programming-converted (4).pptx
 
Introduction of 'C' langauge
Introduction of  'C'  langaugeIntroduction of  'C'  langauge
Introduction of 'C' langauge
 

Recently uploaded

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

C language myths & secrets

  • 1. C language Myth & Secrets. By, Ankush Mundhra BCA II year
  • 2. Contents  Introduction  History of C • Its early development • K&R C • C language standards  Myths & Secrets  Experiment  Q & A
  • 3. Introduction  What is C language ?  C is a high-level and general purpose programming language that is ideal for developing firmware or portable applications. Originally intended for writing system software, C was developed at Bell Labs by Dennis Ritchie for the Unix Operating System (OS) in the early 1970s.
  • 4. of C language -  Simple  Portability  Powerful  Case sensitive  Modularity  Use of Pointers
  • 5. History of C language  Its early developments -  C language was invented for implementing UNIX operating system.  The C programming language is a structure oriented programming language, developed at Bell Laboratories in 1972 by Dennis Ritchie.  C programming language features were derived from an earlier language called “B” (Basic Combined Programming Language – BCPL). Ken Thompson & Dennis Ritchie
  • 6.  K&R C - In 1978, Brian Kernighan and Dennis Ritchie published the first edition of ”The C Programming Language”. This book, known to C programmers as "K&R", served for many years as an informal specification of the language. K&R introduced several language features:  Standard I/O library  Long int data type  Unsigned int data type In the years following the publication of K&R C, several features were added to the language, supported by compilers from AT&T and some other vendors. These included:  Void functions  Assignment for struct data types  Enumerated types  Functions returning struct or union types
  • 7.  C Language Standards - • C89/C90 standard – First standardized specification for C language was developed by the American National Standards Institute in 1989. C89 and C90 standards refer to the same programming language. • C99 standard – Next revision was published in 1999 that introduced new features like advanced data types and other changes.
  • 8. C11 AND EMBEDDED C LANGUAGE – • C11 standard adds new features to C programming language and library like type generic macros, anonymous structures, improved Unicode support, atomic operations, multi- threading and bounds-checked functions. It also makes some portions of the existing C99 library optional and improves compatibility with C++. • Embedded C includes features not available in C like fixed- point arithmetic, named address spaces, and basic I/O hardware addressing. • Operating systems, C compiler and all UNIX application programs are written in C language • It is also called as procedure oriented programming language. The C language is reliable, simple and easy to use. C has been coded in assembly language.
  • 9. Myths & Secrets “ C is quirky, flawed, and an enormous success.” - Dennis Ritchie
  • 10. 1) C is obsolete. No one uses C anymore! It is true that C is the Latin of programming languages and that recent languages are more flexible and let us do amazing stuff with ease. However, most of these languages have emerged from C. They have been built with C as their base.
  • 11. 2) C++ is better than C. There are two versions of everything these days, exactly like C and C++. C is like the 5-inch version of a smartphone and C++ is its 6-inch variant. Both pack almost same features with a few modifications here and there. Whatever you achieve with C, you can achieve with C++. Similarly, whatever you can make in C++, you can also make that with C.
  • 12. 3) C++ is the next version of C! People say C++ is the next version of C, which technically it is NOT, not even close! The term “version” comes into picture when we are dealing with the same thing, for example, Windows 8, Windows 8.1 and so on. In the case of C and C++, they are two different languages. It’s true that they are built on the same base, but they can’t technically be called “versions” as such.
  • 13. 4) Arrays start at 0 rather than 1. Most people start counting at 1, rather than zero. Compiler writers start with zero because we're used to thinking in terms of offsets. This is sometimes tough on non-compiler-writers; although a[100] appears in the definition of an array, we would better not store any data at a[100], since a[0] to a[99] is the extent of the array. 5) No nested functions. Function contained inside another function is known as nested function. This simplifies the compiler and slightly speeds up the runtime organization of C programs.
  • 14. Experiments 1) Difference in data types sizes in GCC and in Turbo compiler. Here is the code - #include<stdio.h> int main() { int *p; printf("%dn", sizeof(int)); printf("%dn", sizeof(char)); printf("%dn", sizeof(float)); printf("%dn", sizeof(double)); printf("%dn", sizeof(p)); return 0; }
  • 15. After Compiling the above code, Here is the output - GCC Compiler Turbo C Compiler
  • 16. 2. Difference in output in Increment Decrement operator. Here is the code - #include<stdio.h> int main() { int i=5; printf("%d%d%d%d%d",i++,i--,++i,--i,i); return 0; }
  • 17. After Compiling the above code, Here is the output - GCC Compiler Turbo C Compiler
  • 18. Reference  Wikipedia  Google  Quora  Arihant All-in-One Computer Science book  Bibhudendu Panda Sir