dasl 130 c programming course n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
DASL 130 – C Programming Course PowerPoint Presentation
Download Presentation
DASL 130 – C Programming Course

Loading in 2 Seconds...

play fullscreen
1 / 10

DASL 130 – C Programming Course - PowerPoint PPT Presentation


  • 141 Views
  • Updated on

DASL 130 – C Programming Course. Lecture 1. Compiler. A compiler turns C code into machine code, in other words an executable file Dev-C++ http://www.bloodshed.net/devcpp.html. Basic Program. “Hello World” Code: #include <stdio.h> int main() { printf("Hello World!"); scanf(" ");

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

DASL 130 – C Programming Course


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
    Presentation Transcript
    1. DASL 130 – C Programming Course Lecture 1

    2. Compiler • A compiler turns C code into machine code, in other words an executable file • Dev-C++ • http://www.bloodshed.net/devcpp.html

    3. Basic Program • “Hello World” Code: #include <stdio.h> int main() { printf("Hello World!"); scanf(" "); return 0; }

    4. Variables • Format: • Type name = value; • Variable names: start with a letter, can not be a keyword • Convention is lowercase for variables, uppercase for constants

    5. Types • Char – 1 byte • Signed is -128 to 127 • Unsigned is 0 to 255 • ASCII Table converts char values to characters • Escape sequences: • \n – new line • \r – line return • \t – tab • \’ \” - quotes

    6. Types • Int • short int – at least 16 bits • int – no larger than long, no shorter than short • long int – at least 32 bits (-2 billion to 2 billion) • long long int – at least 64 bits • Escape sequences • Octal - \000 • Hex - \x00

    7. Types • Float and Double • Float – 6 digit precision • Double – 12 digit precision • Precision is number of digits sizeof() – returns size of a variable in bytes

    8. Qualifiers and Casting • Type Qualifiers • const – variable cannot be modified • volatile – prevents compiler from optimizing around variable • Type Casting • Allows conversion of variable types • float test = (float)5

    9. Operators • Arithmetic + , - , * , / , % (modulus) ++ , -- (prefix and postfix incrementation) += , -= , *= , /= , %= • Logical && , || , == , != • Bit Shifting << , >> , | , & , ^

    10. Standard I/O • Basic Output – printf() • printf(“An integer is %d\n”, int var); • d/i = int, f = floating point, e = exponential notation, c = single char, s = string, o = octal, x/X = hex, u = unsigned int • Basic Input – scanf()