This is not the document you are looking for? Use the search form below to find more!

Report home > Computer / Internet

Tutorial on C Language Programming

2.69 (16 votes)
Document Description
Tutorial on C Language Program Teodor Rus The University of Iowa, Department of Computer Science
File Details
Submitter
  • Username: desantis
  • Name: desantis
  • Documents: 37
Embed Code:

Add New Comment




Showing 1 comment

by john on November 30th, 2010 at 07:24 pm
Learner is affected by many factors in the second language acquisition process. The level of cognitive development, socio-economic and cultural background, and the ability to acquire a ...
Related Documents

An Easy Timer In C Language

by: alfredina, 2 pages

An Easy Timer In C Language

C Language Lab Manual

by: myricoorish, 3 pages

C- LANGUAGE LAB MANUAL C- LANGUAGE LAB MANUAL for B.Tech, B.E and More http://studentyogi.com/?attachment_id=747 September 5th, 2009 · Lab Manuals · No comments · Read More » • ...

THE EFFECTS OF AGE AND MOTIVATION FACTORS ON SECOND LANGUAGE ACQUISITION

by: shinta, 8 pages

Learner is affected by many factors in the second language acquisition process. The level of cognitive development, socio-economic and cultural background, and the ability to acquire a ...

tutorial on Android development

by: TRIPTY SINGH, 242 pages

it is a short and basic tutorial on android developed for educational purpose of students.

C Language Lab Manual B.Tech,Mca,M.Tech

by: henriette, 1 pages

C- LANGUAGE LAB MANUAL C- LANGUAGE LAB MANUAL for B.Tech, B.E and More http://studentyogi.com/?attachment_id=747 • B.TECH • ContractJob • default • Gate • ...

Inhibitory Effects of Ginseng Saponins on c-fos mRNA Expression and the Proliferation of Rat Aortic Vascular Smooth Muscle Cells Stimulated by Angiotensin II

by: shinta, 7 pages

To evaluate the possibility that the ginseng saponins could be developed as an anti-arteriosclerotic agent, we examined the inhibitory effects of ginseng saponins (total saponin[TS], ...

A Tutorial on the McKinsey Model for Valuation of Companies

by: monkey, 56 pages

All steps of the McKinsey model are outlined. Essential steps are: calculation of free cash flow, forecasting of future accounting data (profit and loss accounts and balance sheets), and ...

Swing Tutorial on Netbeans 6.0

by: sasa, 10 pages

MySQL-JSP tutorial February 26, 2008 Presented by: Anwar Hossain Email: anwar@mcrlab.uottawa.ca ...

Socket Programming Tutorial

by: ville, 35 pages

Socket Programming Jignesh Patel Palanivel Rathinam connecting processes Overview Introduction to Sockets A generic Client-Server application ...

Why Java Sucks and C# Rocks (Final)

by: lenora, 118 pages

Why Java Sucks and C# Rocks (Final)

Content Preview
Tutorial on C Language
Programming
Teodor Rus
rus@cs.uiowa.edu
The University of Iowa, Department of Computer Science
Introduction to System Software – p.1/64

Tutorial on C programming
C program structure:
Data structure
Control structure
Program structure
Introduction to System Software – p.2/64

Data structures
Prede?ned data types:
integer (int), small integers (short), large integers
(long)
real numbers (?oat), large real numbers (double)
character data (char)
User de?ned data types using type constructors array,
record, pointer, ?le

Introduction to System Software – p.3/64

Declarations
A data object of a de?ned type T is declared using the
construct of the form T data where T is a type expression
and data is the data object name
Example:
int x declares x an object of type integer
short x declares x an object of type small integer
long x declares x an object of type large integer
?oat x declares x an object of type real
double x declares x an object of type large real
char x declares x an object of type character
Introduction to System Software – p.4/64

De?nitions
An object of a user de?ned type T is constructed using
one of the type constructors struct, [], *, FILE that takes
as arguments objects of already de?ned types.
A new user de?ned type T is constructed using the
meta-constructor typedef and a type or a type
constructor
Introduction to System Software – p.5/64

Record type de?nition
A record type is de?ned using the struct constructor
following the template:
struct TypeName
{
component1;
component2;
component3;
}
Components are object declarations of the form T
ObjName;

Note: TypeName is an abstraction
Introduction to System Software – p.6/64

Record object declaration
An object of type TypeName is obtained by the
declaration
TypeName MyRecord
One can put together the de?nition and the declaration
getting:
struct TypeName
{
component1;
component2;
component3;
} MyRecord;
Introduction to System Software – p.7/64

Example record
Example of a record type de?nition and declaration is:
struct Data
{
int Day;
int Month;
int Year;
} MyData, *MyPT, MyArray[Max];
Note: type expressions are obtained by combining the
type constructors struct, *, [], in a well de?ned manner
Introduction to System Software – p.8/64

Reference to record components
MyData.Year, MyData.Month, MyData.Day are
references at the components of the data object
MyData
M yP T ? > Y ear, M yP T ? > M onth, M yP T ? > Day are
pointer reference to the same components.
Note, we need to use MyPT = &MyData before this
reference make sense; i.e.,
M yP T ? > Y ear ? (?M yP T ).Y ear.
Introduction to System Software – p.9/64

Memory representation of records
Consider the following de?nition and declarations:
struct example
{
int x;
int *y;
} Obj, *PtObj;
Introduction to System Software – p.10/64

Document Outline
  • Tutorial on C programming
  • Data structures
  • Declarations
  • Definitions
  • Record type definition
  • Record object declaration
  • Example record
  • Reference to record components
  • Memory representation of records
  • Memory representation
  • Memory representation of PtObj
  • Facts about records
  • Array data type
  • Array memory representation
  • Union data type
  • Reference to union components
  • Example of a union usage
  • Reference to union components
  • Pointer data type
  • Example pointers
  • Pointer references
  • File data type
  • Operations with file
  • User defined types
  • Examples
  • Control Flow Structures
  • C language computation units
  • Assignment statement
  • Branching statements
  • If-statement
  • If-else statement
  • Switch statement
  • Break statement
  • Continue statement
  • Unconditional jump statement
  • Looping statements
  • While statement
  • Do-while statement
  • For statement
  • Block statement
  • Function definition
  • Example
  • Function declaration
  • Function call
  • Parameter passing
  • Remember
  • Function memory representation
  • Activation record
  • Structure of a function in memory
  • Structure of a C language program
  • Note
  • Macro definition component
  • Global declarations
  • Main function of the program
  • Program execution
  • Other function components
  • Example program
  • Bonus point assignment
  • Program memory representation
  • Data segment
  • Text segment
  • Stack segment
  • Development of a C program

Download
Tutorial on C Language Programming

 

 

Your download will begin in a moment.
If it doesn't, click here to try again.

Share Tutorial on C Language Programming to:

Insert your wordpress URL:

example:

http://myblog.wordpress.com/
or
http://myblog.com/

Share Tutorial on C Language Programming as:

From:

To:

Share Tutorial on C Language Programming.

Enter two words as shown below. If you cannot read the words, click the refresh icon.

loading

Share Tutorial on C Language Programming as:

Copy html code above and paste to your web page.

loading