SlideShare a Scribd company logo
1 of 130
C Programming ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Preparing to program ,[object Object],[object Object],[object Object],[object Object]
Feature of C Program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Structured Language ,[object Object],[object Object],[object Object]
Portability ,[object Object],[object Object],[object Object]
General Purpose Language ,[object Object],[object Object],[object Object],[object Object],[object Object]
Code Re usability and Ability to  Customize and Extend ,[object Object],[object Object],[object Object],[object Object],[object Object]
Limited number  of keywords and unix library function ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
'C' program structure ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Writing,compiling and executing ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Recap of previous session ,[object Object],[object Object],[object Object],[object Object]
Introduction ,[object Object],[object Object],[object Object],[object Object]
Data types ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
'C' has five basic built in data type   ,[object Object],[object Object],[object Object],[object Object],[object Object]
Void is used to ,[object Object],[object Object],[object Object],[object Object]
Declaring a variable ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Assigning values ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Type Modifier ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Character ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Integer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Real number ,[object Object],[object Object],[object Object],[object Object]
Signed and unsigned prefixes ,[object Object],[object Object],[object Object]
Character Set ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Keywords and Indentifier ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
keywords ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Constants ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
C supports several types constant ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Escape sequences ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Access modifier ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Operator ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Three general classes of operator ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Arithmetic Operators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
casting ,[object Object],[object Object],[object Object],[object Object],[object Object]
Implicit casting ,[object Object],[object Object],[object Object],[object Object]
Explicit casting ,[object Object],[object Object],[object Object],[object Object],[object Object]
Linking with math library ,[object Object],[object Object],[object Object],[object Object]
Unary operator ,[object Object],[object Object],[object Object],[object Object],[object Object]
Increment and Decrement ,[object Object],[object Object],[object Object],[object Object],[object Object]
Postfix and Prefix ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Relational and Logical operator ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Conditional (:?) Operator ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Recap of previous session ,[object Object],[object Object],[object Object]
POINTERS ,[object Object],[object Object],[object Object]
POINTERS  CONT.. ,[object Object],[object Object],[object Object],[object Object]
POINTERS  CONT.... ,[object Object],[object Object],[object Object],[object Object]
POINTERS ,[object Object],[object Object],[object Object],[object Object]
POINTERS ,[object Object],[object Object],[object Object],[object Object],[object Object]
NULL POINTERS ,[object Object],[object Object],[object Object],[object Object]
NULL POINTERS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Equivalence in Array and pointer ,[object Object],[object Object],[object Object],[object Object]
Arrays and Pointers as Function Arguments ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
String ,[object Object],[object Object],[object Object],[object Object]
Preprocessor Directives ,[object Object],[object Object],[object Object],[object Object],[object Object]
Notes  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Macros ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Getchar( ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Putchar( ) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Printf( ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scanf( ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
List all format ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Mixed data Output ,[object Object],[object Object],[object Object],[object Object]
Types ,[object Object],[object Object]
Types ,[object Object],[object Object],[object Object],[object Object]
Types cont... ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Constants A constant is just an immediate, absolute value found in an expression. The simplest constants are decimal integers, e.g. 0, 1, 2, 123 . Occasionally it is useful to specify constants in base 8 or base 16 (octal or hexadecimal); this is done by prefixing an extra 0 (zero) for octal, or 0x for hexadecimal: the constants 100, 0144, and 0x64 all represent the same number. (If you're not using these non-decimal constants, just remember not to use any leading zeroes. If you accidentally write 0123 intending to get one hundred and twenty three, you'll get 83 instead, which is 123 base 8.)
Declaration ,[object Object],[object Object],[object Object]
Function calls ,[object Object],[object Object],[object Object],[object Object]
Expression statement ,[object Object],[object Object],[object Object],[object Object],[object Object]
If statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Boolean expression ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
While loop ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
For loop ,[object Object],[object Object]
Break and continue  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Character output  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
File pointer and Fopen ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
I/O with file pointer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Predefined Stream ,[object Object],[object Object],[object Object],[object Object],[object Object]
Closing files  ,[object Object],[object Object]
Character Input/output  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
UNIX File Redirection ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Memory Management Dynamic memory management
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Introduction / Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Memory Leak  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Memory Leak  cont… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Valgrind
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Valgrind   cont…
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Valgrind  cont…
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Valgrind  cont…
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Valgrind  cont…
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Valgrind  cont…
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Valgrind  cont…
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Case studies
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Case studies
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Case studies
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Case studies
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Case studies
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Valgrind  cont…
[object Object],[object Object],[object Object],Bounds Checker
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Bounds Checker  cont…
[object Object],[object Object],[object Object],[object Object],Bounds Checker  cont …
[object Object],[object Object],[object Object],[object Object],[object Object],Bounds Checker  cont…
Case studies ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],Case studies
[object Object],[object Object],[object Object],[object Object],Case studies
[object Object],[object Object],[object Object],[object Object],Case studies
[object Object],[object Object],[object Object],Case studies
[object Object],[object Object],[object Object],Case studies  cont…
[object Object],[object Object],[object Object],[object Object],[object Object],Summary
[object Object],[object Object],[object Object],[object Object],[object Object],Reference
Linked list  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Concept of linked list ,[object Object],[object Object],[object Object],[object Object],[object Object]
Arrays  ,[object Object]
Array cont....... ,[object Object]
Array cont....... ,[object Object]
Array cont....... ,[object Object],[object Object],[object Object],[object Object]
Other String Handling Functions ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],Programs with Several Files
Advantage of using several files The main advantages of spreading a program across several files are:  Teams of programmers can work on programs. Each programmer works on a different file.  An object oriented style can be used. Each file defines a particular type of object as a datatype and operations on that object as functions. The implementation of the object can be kept private from the rest of the program. This makes for well structured programs which are easy to maintain.  Files can contain all functions from a related group. For Example all matrix operations. These can then be accessed like a function library.  Well implemented objects or function definitions can be re-used in other programs, reducing development time.  In very large programs each major function can occupy a file to itself. Any lower level functions used to implement them can be kept in the same file.  Then programmers who call the major function need not be distracted by all the lower level work.  When changes are made to a file, only that file need be re-compiled to rebuild the program. The UNIX make facility is very useful for rebuilding multi-file programs in this way.
How to Divide a Program between Several Files Where a function is spread over several files, each file will contain one or more functions. One file will include main while the others will contain functions which are called by others. These other files can be treated as a library of functions.  Programmers usually start designing a program by dividing the problem into easily managed sections. Each of these sections might be implemented as one or more functions. All functions from each section will usually live in a single file.  Where objects are implemented as data structures, it is usual to to keep all functions which access that object in the same file. The advantages of this are;  The object can easily be re-used in other programs.
How to Divide a Program between Several Files All related functions are stored together.  Later changes to the object require only one file to be modified.  Where the file contains the definition of an object, or functions which return values, there is a further restriction on calling these functions from another file. Unless functions in another file are told about the object or function definitions, they will be unable to compile them correctly.  The best solution to this problem is to write a header file for each of the C files. This will have the same name as the C file, but ending in .h. The header file contains definitions of all the functions used in the C file.  Whenever a function in another file calls a function from our C file, it can define the function by making a #include of the appropriate .h file.
Organization of Data in File Any file must have its data organized in a certain order. This will typically be:  A preamble consisting of #defined constants, #included header files and typedefs of important data types  Declaration of global and external variables. Global variables may also be initialized here.  One or more functions.  The order of items is important, since every object must be defined before it can be used. Functions which return values must be defined before they are called. This definition might be one of the following:
Organization of Data in File Where the function is defined and called in the same file, a full declaration of the function can be placed ahead of any call to the function.  If the function is called from a file where it is not defined, a prototype should appear before the call to the function.  A function defined as  float find_max(float a, float b, float c) {  /* etc ... ... */ would have a prototype of  float find_max(float a, float b, float c);  The prototype may occur among the global variables at the start of the source file. Alternatively it may be declared in a header file which is read in using a #include.  It is important to remember that all C objects should be declared before use.
[object Object],[object Object],[object Object],[object Object],[object Object],Compiling Multi-File Programs
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Separate Compilation
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Using make with Multi-File Programs
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Using make with Multi-File Programs CONT....
Reading lines ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Reading number ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
IntelliBitz Technologies Training Division 168, Medavakkam Main Road Madipakkam, Chennai 91. PH: +91 044 2247 5106 www.intellibitz.com [email_address]

More Related Content

What's hot

What's hot (20)

Pointers C programming
Pointers  C programmingPointers  C programming
Pointers C programming
 
C string
C stringC string
C string
 
Programming in c Arrays
Programming in c ArraysProgramming in c Arrays
Programming in c Arrays
 
Unit 2. Elements of C
Unit 2. Elements of CUnit 2. Elements of C
Unit 2. Elements of C
 
Dynamic memory allocation in c
Dynamic memory allocation in cDynamic memory allocation in c
Dynamic memory allocation in c
 
Strings in c
Strings in cStrings in c
Strings in c
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Keywords in c language
Keywords in c languageKeywords in c language
Keywords in c language
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
 
Tokens in C++
Tokens in C++Tokens in C++
Tokens in C++
 
Data types
Data typesData types
Data types
 
Looping statements in C
Looping statements in CLooping statements in C
Looping statements in C
 
How to execute a C program
How to execute a C  program How to execute a C  program
How to execute a C program
 
Pointer in c
Pointer in cPointer in c
Pointer in c
 
Fundamental of C Programming (Data Types)
Fundamental of C Programming (Data Types)Fundamental of C Programming (Data Types)
Fundamental of C Programming (Data Types)
 
INLINE FUNCTION IN C++
INLINE FUNCTION IN C++INLINE FUNCTION IN C++
INLINE FUNCTION IN C++
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
Programming For Problem Solving Lecture Notes
Programming For Problem Solving Lecture NotesProgramming For Problem Solving Lecture Notes
Programming For Problem Solving Lecture Notes
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programming
 
Enumerated data types in C
Enumerated data types in CEnumerated data types in C
Enumerated data types in C
 

Viewers also liked (20)

Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
 
IT BOOK
IT BOOKIT BOOK
IT BOOK
 
Hands-on Introduction to the C Programming Language
Hands-on Introduction to the C Programming LanguageHands-on Introduction to the C Programming Language
Hands-on Introduction to the C Programming Language
 
Computer Literacy Beginers
Computer Literacy BeginersComputer Literacy Beginers
Computer Literacy Beginers
 
Teamwork Works!
Teamwork Works!Teamwork Works!
Teamwork Works!
 
Soc mobyear2
Soc mobyear2Soc mobyear2
Soc mobyear2
 
PageMaker - R.D.sivakumar
PageMaker - R.D.sivakumarPageMaker - R.D.sivakumar
PageMaker - R.D.sivakumar
 
Li fi
Li fiLi fi
Li fi
 
Pagemaker handout by Engr. Spark Ovadje
Pagemaker handout by Engr. Spark OvadjePagemaker handout by Engr. Spark Ovadje
Pagemaker handout by Engr. Spark Ovadje
 
Page maker
Page makerPage maker
Page maker
 
String operation
String operationString operation
String operation
 
Robotics workshop PPT
Robotics  workshop PPTRobotics  workshop PPT
Robotics workshop PPT
 
Objective-C
Objective-CObjective-C
Objective-C
 
Css & dhtml
Css  & dhtmlCss  & dhtml
Css & dhtml
 
Objective c slide I
Objective c slide IObjective c slide I
Objective c slide I
 
Ip Spoofing
Ip SpoofingIp Spoofing
Ip Spoofing
 
My ppt..priya
My ppt..priyaMy ppt..priya
My ppt..priya
 
C programming & data structure [character strings & string functions]
C programming & data structure   [character strings & string functions]C programming & data structure   [character strings & string functions]
C programming & data structure [character strings & string functions]
 

Similar to CProgrammingTutorial

Similar to CProgrammingTutorial (20)

C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
C
CC
C
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
C programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer CentreC programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer Centre
 
C language ppt
C language pptC language ppt
C language ppt
 
history of c.ppt
history of c.ppthistory of c.ppt
history of c.ppt
 
C programming tutorial
C programming tutorialC programming tutorial
C programming tutorial
 
Cnotes
CnotesCnotes
Cnotes
 
Ch02
Ch02Ch02
Ch02
 
C introduction
C introductionC introduction
C introduction
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
C programming language
C programming languageC programming language
C programming language
 
Basics of c
Basics of cBasics of c
Basics of c
 
C programming notes.pdf
C programming notes.pdfC programming notes.pdf
C programming notes.pdf
 
C notes
C notesC notes
C notes
 
C programming notes
C programming notesC programming notes
C programming notes
 
Msc prev updated
Msc prev updatedMsc prev updated
Msc prev updated
 

More from Muthuselvam RS

UpsilonPiEpsilon-UniversityOfBridgeport-May1997
UpsilonPiEpsilon-UniversityOfBridgeport-May1997UpsilonPiEpsilon-UniversityOfBridgeport-May1997
UpsilonPiEpsilon-UniversityOfBridgeport-May1997Muthuselvam RS
 
Hibernate Developer Reference
Hibernate Developer ReferenceHibernate Developer Reference
Hibernate Developer ReferenceMuthuselvam RS
 

More from Muthuselvam RS (7)

UpsilonPiEpsilon-UniversityOfBridgeport-May1997
UpsilonPiEpsilon-UniversityOfBridgeport-May1997UpsilonPiEpsilon-UniversityOfBridgeport-May1997
UpsilonPiEpsilon-UniversityOfBridgeport-May1997
 
Spring User Guide
Spring User GuideSpring User Guide
Spring User Guide
 
Gears User Guide
Gears User GuideGears User Guide
Gears User Guide
 
Ant User Guide
Ant User GuideAnt User Guide
Ant User Guide
 
Subversion User Guide
Subversion User GuideSubversion User Guide
Subversion User Guide
 
PHP Web Programming
PHP Web ProgrammingPHP Web Programming
PHP Web Programming
 
Hibernate Developer Reference
Hibernate Developer ReferenceHibernate Developer Reference
Hibernate Developer Reference
 

Recently uploaded

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
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
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
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

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
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
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
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

CProgrammingTutorial

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65. Constants A constant is just an immediate, absolute value found in an expression. The simplest constants are decimal integers, e.g. 0, 1, 2, 123 . Occasionally it is useful to specify constants in base 8 or base 16 (octal or hexadecimal); this is done by prefixing an extra 0 (zero) for octal, or 0x for hexadecimal: the constants 100, 0144, and 0x64 all represent the same number. (If you're not using these non-decimal constants, just remember not to use any leading zeroes. If you accidentally write 0123 intending to get one hundred and twenty three, you'll get 83 instead, which is 123 base 8.)
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81. Memory Management Dynamic memory management
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.
  • 95.
  • 96.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101.
  • 102.
  • 103.
  • 104.
  • 105.
  • 106.
  • 107.
  • 108.
  • 109.
  • 110.
  • 111.
  • 112.
  • 113.
  • 114.
  • 115.
  • 116.
  • 117.
  • 118.
  • 119. Advantage of using several files The main advantages of spreading a program across several files are: Teams of programmers can work on programs. Each programmer works on a different file. An object oriented style can be used. Each file defines a particular type of object as a datatype and operations on that object as functions. The implementation of the object can be kept private from the rest of the program. This makes for well structured programs which are easy to maintain. Files can contain all functions from a related group. For Example all matrix operations. These can then be accessed like a function library. Well implemented objects or function definitions can be re-used in other programs, reducing development time. In very large programs each major function can occupy a file to itself. Any lower level functions used to implement them can be kept in the same file. Then programmers who call the major function need not be distracted by all the lower level work. When changes are made to a file, only that file need be re-compiled to rebuild the program. The UNIX make facility is very useful for rebuilding multi-file programs in this way.
  • 120. How to Divide a Program between Several Files Where a function is spread over several files, each file will contain one or more functions. One file will include main while the others will contain functions which are called by others. These other files can be treated as a library of functions. Programmers usually start designing a program by dividing the problem into easily managed sections. Each of these sections might be implemented as one or more functions. All functions from each section will usually live in a single file. Where objects are implemented as data structures, it is usual to to keep all functions which access that object in the same file. The advantages of this are; The object can easily be re-used in other programs.
  • 121. How to Divide a Program between Several Files All related functions are stored together. Later changes to the object require only one file to be modified. Where the file contains the definition of an object, or functions which return values, there is a further restriction on calling these functions from another file. Unless functions in another file are told about the object or function definitions, they will be unable to compile them correctly. The best solution to this problem is to write a header file for each of the C files. This will have the same name as the C file, but ending in .h. The header file contains definitions of all the functions used in the C file. Whenever a function in another file calls a function from our C file, it can define the function by making a #include of the appropriate .h file.
  • 122. Organization of Data in File Any file must have its data organized in a certain order. This will typically be: A preamble consisting of #defined constants, #included header files and typedefs of important data types Declaration of global and external variables. Global variables may also be initialized here. One or more functions. The order of items is important, since every object must be defined before it can be used. Functions which return values must be defined before they are called. This definition might be one of the following:
  • 123. Organization of Data in File Where the function is defined and called in the same file, a full declaration of the function can be placed ahead of any call to the function. If the function is called from a file where it is not defined, a prototype should appear before the call to the function. A function defined as float find_max(float a, float b, float c) { /* etc ... ... */ would have a prototype of float find_max(float a, float b, float c); The prototype may occur among the global variables at the start of the source file. Alternatively it may be declared in a header file which is read in using a #include. It is important to remember that all C objects should be declared before use.
  • 124.
  • 125.
  • 126.
  • 127.
  • 128.
  • 129.
  • 130. IntelliBitz Technologies Training Division 168, Medavakkam Main Road Madipakkam, Chennai 91. PH: +91 044 2247 5106 www.intellibitz.com [email_address]