sysprog2 Part1

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    sysprog2 Part1 - Presentation Transcript

    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  ● pre­processor 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 ●    
    5. Variable Declaration: Continue Language Predefined data types ● Memory  – User defined types: typedef, structure ●    
    6. Scopes Global Variables ● {} operator ● Example on scopes ●    
    7. Operators Arithmetic (*, / ,% ,+ ,­ ,pre/post++, pre/post­­)  ● Relational (<,>,<=,>=,==,!=, !) ● Logical (&&, ||) and Bitwise (>> ,<< ,& ,^ ,| ,~ ) ● Assignment (=,+=,­=,*=,/=,<<=,>>=, %=,| ● =,&=,^=) http://en.wikipedia.org/wiki/Operators_in_C_and ● _C++    
    8. Casting  Explicit cast ● char x = 'a'; int y = (int) x; – int x = 5; char y = (char) x; – Arithmetic Conversions ● Widening – Type balancing – Sign balancing –    
    9. Conditionals If statement ● switch statement ● ternary operator ? ● x=10; – y = x>9 ? 100:200; –    
    10. Loops for example ● while example ● do while example ● break and continue example (good point to  ● show infinite loop)    

    + Ahmed MekkawyAhmed Mekkawy, 8 months ago

    custom

    137 views, 0 favs, 0 embeds more stats

    first part of the second session in phase I of syst more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 137
      • 137 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 3
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories