Sie sind auf Seite 1von 5

1 TRAINING

The purpose of this training is to train you for good ‘C’ programming and logic implementation. You will explore
and understand the details and syntax of C language. You will also learn and look at the coding guidelines for
good programming in ‘C’ (Refer to Coding style and Guidelines documents)

1.1 Coding style, convention


Task:
Read documents for Coding style and guidelines and implement the learning while writing codes.

Objective:
Get familiar with the coding style and convention for writing manageable codes.

Assignment:
None

1.2 Scalar data type, Operator, Control flow, loops


Task:
Read following topics from The C Language Programming Language, by Kernighan and Ritchie.

Scalar Data Types


• Numbers – Integer, Float, Octal and Hex Notation.
• Constants and escape sequences.
Operators
• Arithmetic Operators
• Relational and Logical operators
• Increment and decrement operators
• Bit-wise operator
• Precedence and order of evaluation
• Practical Exercises
Control Flow
• If-else. Else-if
• Switch
Loops
• While and For, Exercise atoi function (topic 3.5)
• Do-While, Exercise itoa function (topic 3.6)
• Break-Continue

Objective:
Learn basic C syntax and write programs based on above topics.

Assignment:
Do exercise 2.4, 2.5, 2.6, 2.9, 2.10, 3.1 and 3.2 (3.3 to 3.6 are there in topic 3.5 and 3.6, we have included
them in loops section.)
Here trainee’s need to handle the error conditions also for each assignment.

1.3 Functions and Preprocessor directives


Task:
Read following topics from The C Language Programming Language, by Kernighan and Ritchie.

Functions
• Basics of functions
• Scope rule
• External variables
• Header files
• Static variable
• Register variable
• Recursion
• The C Preprocessor

Read chapter number 15 from Advanced C.pdf for better understanding of preprocessor directives and
conditional compilation.

Objective:
Learn and get familiar with functions in C and write programs based on above topic.

Assignment:
Do exercise 4.4, 4.5, 4.8, 4.9, 4.10, 4.11 and 4.12, 4.14

1.4 Understanding Pointers


For understanding of pointers please refer to the book Understanding Pointers in C, by Yashavant
Kanitkar, 3rd Edition
1.4.1 Introduction to pointers
Task:
Read following topics from (chapter-1), Understanding Pointers in C, by Yashavant Kanitkar,
Introduction to Pointers
• The & and * operators
• Pointer Expressions
• The Jargon of Pointers
• Char, int and float Pointers
• Passing Address to Functions
• Functions Returning Pointers
• Solved problems

Objective:
Get familiar with basics of pointers.

Assignment:
All Exercise
1.4.2 Pointers and Arrays
Task:
Read following topics from (chapter-2), Understanding Pointers in C, by Yashavant Kanitkar,
Pointers and Arrays
• What are arrays
• Passing Array elements to a function
• Pointers and arrays
• Passing an entire array to a function
• The real thing
• More than one dimention
• Pointers and Two dimensional arrays
• Pointers to an array
• Passing 2-D array to a function
• Array of pointers
• Dynamic memory allocation
• Solved problems

Objective:
To learn and understand how array elements are stored internally and using pointers to access array
elements.

Assignment:
All Exercise
1.4.3 Pointers and Strings
Task:
Read following topics from (chapter-3),Understanding Pointers in C, by Yashavant Kanitkar,
Pointers and Strings
• What are strings
• Standard library string functions
• Pointers and strings
• The const qualifier
• Returning const values
• Solved problems

Objective:
To learn how strings can be accessed by using pointers. Understand const qualifier

Assignment:
Section A – 3, 4 & 5(keep the encryption logic simple) and Section B - all
1.4.4 Pointers and Structures
Task:
Read following topics from (chapter-4), Understanding Pointers in C, by Yashavant Kanitkar,
Pointers and Structures
• An array of structures
• More about structures
• Structure pointers
• Offsets of structure elements
• Solved problems

Objective:
To learn and understand how structures can be accessed through pointers

Assignment:
Section A – 2, 4 & 5 Section B – 1, 3 to 5
1.4.5 Pointers Miscellany
Task:
Read following topics from (chapter-6), Understanding Pointers in C, by Yashavant Kanitkar,
Pointers Miscellany
• File Pointers
• Pointers to Functions
• Typedef with Function pointers
• Argc and argv – Arguments to main()
• Pointers and Variable number of arguments
• Near, far and huge pointers
• Which pointers to use ?

Objective:
To understand file pointers, pointers to functions and argc and argv pointers.

Assignment:
Section 5 – 5 Section B - all

1.5 Structure, Union, typedef, macros


Task:
Read following topics from The C Language Programming Language, by Kernighan and Ritchie.
• Basics of structures
• Structure and functions
• Array of structure
• Type def
• Unions
• Bit-fields

Read Macros and Miscellaneous Pitfalls.doc to understand probable pitfalls of using macros.

Read Unions.doc to understand practical use of unions.

Objective:
Learn and get familiar with Structures, union, typdef and bit-field in C and write programs based on above
topics.

Assignment:
Do exercise 6.1

1.6 File operations


Task:
Read following topics from The C Language Programming Language, by Kernighan and Ritchie.

• Standard input and output


• Formatted output-Printf
• Formatted input-Scanf
• File Access
• File open(fopen)
• File read(fread)
• File write(fwrite)
• File Close(fclose)
• File print(fprintf)
• File Scan(fscanf)
• File seek
• File line in(fgets)
• File line out(fputs)
• File length

Objective:
Learn and get familiar with File operations in C and write programs based on above topics.

Assignment:
Do exercise 7.3, 7.5, 7.6 and 7.7

1.7 Miscellaneous reading


Task:
Read following documents.

• reentrancy.doc
• C Optimisation tutorial.htm
• C Programming - Just the FAQs.pdf

Objective:
To understand concepts of writing Reentrant and Thread-safe codes, writing Optimized codes, understand
answers of many frequently asked questions on C concepts.

Assignment:
1.8 Assignments
1.8.1 Assignment 1
Task: Write a program that finds float number from anywhere in a string
1.8.2 Assignment 2
Task: Write a Program that removes repetitive numbers from an array
1.8.3 Assignment 3
Task: Write a program to draw swastik with * in 9 X 9 pixel area.
1.8.4 Assignment 4
Task: Write a program that finds number of ones (1) in binary equivalent of an integer number.
1.8.5 Assignment 5
Task: Write a program to convert decimal number to Roman equivalent
1.8.6 Assignment 6
Task: Write a program to reverse an array without using another array.
1.8.7 Assignment 7
Task: Write a program that will work as command equivalent to “grep” with all its options
1.8.8 Assignment 8
Task: Write a cross-reference that prints a list of all words in a document, and for each word, a list of the line
numbers on which it occurs. Remove noise words like ‘the’, ‘and,’ and so on
1.8.9 Assignment 9
Task: Write a program to compare two files, printing the first line where they differ
1.8.10 Assignment 10
Task: To copy a file into another file using command line arguments.

1.9 Written test (Multiple Choice Question)


Task:
Go through 30 minutes of written test which consists of multiple choice questions and fill in blanks kind of
questions.

Objective: This will help you to analyze your own understanding of C language in depth.

Assignment: Written test

Das könnte Ihnen auch gefallen