lect_02 - CSI 333 – Lecture 2 Introduction to C: Part I...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSI 333 – Lecture 2 Introduction to C: Part I 2–1/ 16 Basics of C Remark: Skim Chapters 1 through 6 of Deitel & Deitel. You will notice the following: C is (more or less) a subset of Java . (So, you are not really learning a “new” language.) The differences between C and Java are not difficult to master. Why learn C now? C is usually preferred over Java in implementing systems software because: C compilers generating good quality machine code are readily available. Size of executable created from a C source is typically smaller. 2–2/ 16 Basics of C (continued) Parts common to C and Java: Primitive data types ( int , char , float and double ). Arrays. Arithmetic and logical operators and expressions. Pre and post increment/decrement operators. Assignment statement. Control statements ( if , switch , etc.) Loops ( for , while , etc.). Functions and return statement. Note: The above list is not exhaustive. Main Difference C is not an object-oriented language. 2–3/ 16 A Simple C Program (Example 1) #include <stdio.h> int main(void) { printf("Hello World!\n"); return 0; } /* End of main. */ Notes about the program: Every C program must have a function named main . In the above example, The main function returns a value of type int . The function does not have any parameters. 2–4/ 16 Notes on Example 1 (continued) <stdio.h> : Header file needed to use I/O functions (such as printf ). Each C program can use three standard I/O devices: stdin , stdout and stderr ....
View Full Document

This note was uploaded on 11/22/2010 for the course ICSI 333 taught by Professor Ravi during the Spring '10 term at SUNY Albany.

Page1 / 16

lect_02 - CSI 333 – Lecture 2 Introduction to C: Part I...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online