project iccwin
TRANSCRIPT
Acknowledgements
Any attempt at any level cannot be satisfactory completed without the support and guidance of learned people. We would like to express our immense gratitude to Ms Vartika Singh on computer programming for their constant support and motivation that has encouraged us to come up with this project.
We are also thankful to all our colleagues who have rendered their whole hearted support at all times for the successful completion of this project.
INDEX
CHAPTER 1 INTRODUCTION TO C
Program Organisation
Hello
Program input What are “function parameters”? Console mode programs and windows programs An overview of the compilation process Technical notes The run time environment
An overview of the standard libraries
The “stdheaders.h” include file Windows specific headers
Passing arguments to a program
Iteration constructs Basic types
Declaration and definitions
Variable declaration Types Function declaration Function definitions Variable definition Statement syntax
Errors and warnings
Reading from a file
Commentaries
Describing a function Describing a file
An overview of the whole language
Statements Declaration Pre-processor Windows specific defined symbols Structured exception handling Control-flow Windows specific syntax
Extensions of Icc-win32
A closer view
Identifiers Constants
The print family
Conversions The conversion flags The size specification The conversions Scanning values
Pointers
Operations with pointers Null pointers
Setjmp and longjmp
General usage Register variables and longjmp()
Simple programs
strchr strlen
strlwr
Using arrays and sorting
How to sort arrays Summary of Arrays and sorting
Pointers and references
Structures and unions
Structures Structure size Defining new types Unions
Using structures
Fine points of structure use An important structure
Identifier scope and linkage
Top-down analysis
Extending a program
The problems with C-“Strings”
Memory management and memory layout
Functions for memory allocation Memory layout under windows
Memory management strategies
Stack based allocation
Counting words
The organization of the table Memory organization Displaying the results Code review
Time and Date functions
Using structures (continued)
Lists Hash tables
Using function pointers
Numerical programming
Floating point formats What can we do with those numbers then? Numerical stability Complex numbers
Programming with security in mind
Always include a ‘default’ in every switch statement Pay attention to strlen and strcpy Do not assume correct input Watch out for Trojans
Pitfalls of the C language
Defining a variable in a header file Confusing = and == Forgetting to close a comment Easily changed block scope Using the ++ or – more than once in an expression Unexpected Operator Precedence Extra Semi-Colon in Macros Watch those semicolons! Assuming pointer size is equal to integer size Careful with unsigned numbers Changing constant strings Indefinite order of evaluation A local variable shadows a global one Careful with integer wrap around Problems with integer casting Octal numbers
Bibliography
CHAPTER 2 STRINGS
Design criteria
Memory management The handling of exceptions Efficiency considerations C and C++
Description
Creating strings Copying Accessing the characters in a String String pointer operations
Implementation
String functions Joining strings Accessing Mapping and filtering Conversations File Operations Reversing a String Searching text Making a string from a pipe Joining strings Strmap Filters