This document provides an overview of C syntax for a Linux session. It outlines the basic tools needed to write C programs, including gcc and a text editor. It then covers various aspects of C syntax such as program structure, variables, data types, scopes, operators, casting, conditionals, and loops. The document is presented as a slideshow by system administrator Eng. Riham AlDakkak.
Boost Fertility New Invention Ups Success Rates.pdf
C for Linux Session 2 C Syntax Overview
1. C for Linux
Session 2
C Syntax
BY:
Eng.Riham AlDakkak
System Administrator
2. Getting Started
What tools do I need to get started?
●
gcc, text editor
–
Say hello to the world in C
●
Compilation and execution
–
A Closer look at the program
–
3. A look at a C program structure
General form of a C program is as
●
preprocessor directives
–
global declarations
–
main()
–
other functions
–
4. Variables
Variable declaration
●
C is a static typing language
–
int x, y;
●
int x=0, y=1; //initialization
●
Language Predefined data types
–
double, float
●
(signed, unsigned ) int, short, long, long long
●
char, unsigned char – ASCIIure
●