O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

C Programming[Sample]

773 visualizações

Publicada em

It is a Sample of my Full Presentation about Programming using C language the Full one is more than 50 slide

Publicada em: Software
  • Seja o primeiro a comentar

C Programming[Sample]

  1. 1. PROGRAMMING USING C LANGUAGE BY: MOSTAFA ALI
  2. 2. HISTORY OF C LANGUAGE • C language implemented by Dennis Ritchie in 1970 as a development process of Blanguage. • C89 Standard or ANSI C (American National Standards Institute) implemented on 1989. • ISO (International Standard Organization) implemented on 1990 or called. • C99 Standard implemented on 1999 and it’s a quit different of previous Versions. 2015All Copyrights Reserved © Mostafa Ali 1
  3. 3. WHY USE C • C language is a Middle-level language so it’s easy to Compile and easy to Understand by the Programmer. • High Portability, High Protection and Much Higher Efficiency (how to use least resources as possible). • C89 Standard has 32 Words and this standard what we are going to study. • The C language is a Subset of C++. 2015 All Copyrights Reserved © Mostafa Ali 2
  4. 4. C-PROGRAMMING LIFE-CYCLE [1] • Life-Cycle Means the process that takes starting from writing the code to reach the executable (running) file. • Source code(*.c): text of the program that you can read (input to Compiler). • Object code(*.o): transformation from source code to machine code (input to Linker). • Linker: a program that links separately compiled modules into one program, It also combines the functions in the standard C library with the code that you wrote (the output of the linker is an executable file). 2015 All Copyrights Reserved © Mostafa Ali 3
  5. 5. C-PROGRAMMING LIFE-CYCLE [2] • Linker Script or Linker Directive (ld): The ld command language is a collection of statements; some are simple keywords setting a particular option, some are used to select and group input files or name output files; and two statement types have a fundamental and high impact on the linking process. • The most fundamental command is the SECTIONS command . Every meaningful command script must have a SECTIONS command: it specifies a "picture" of the output file's layout. • The MEMORY command complements SECTIONS by describing the available memory in the target architecture. This command is optional; if you don't use a MEMORY command, ld assumes sufficient memory is available in a contiguous block for all output. 2015 All Copyrights Reserved © Mostafa Ali 4
  6. 6. C-PROGRAMMING LIFE-CYCLE [3] 2015 All Copyrights Reserved © Mostafa Ali 5 • Library: the file containing the standard functions that your program can use. • Mapping: is a map of how the memory section dividing according to what was written on “ld”. • Compile Time: the time that the program is being Compiled. • Run Time: the time that the program is Excuted.
  7. 7. Linker File.exe, File.hex (Executable File) File.map(Mapping File) Assembler File.o (Object File) Compiler File.s (Assembly File) Preprocessor File.i, File.pre (Extended Source Code File) Editor File.c File.h 2015 All Copyrights Reserved © Mostafa Ali 6 ld(LinkerDirective)+ OtherObjectFiles+ LibraryFiles
  8. 8. DATA TYPES IN C [1] Data Type Size In Bits Size in Bytes Range char 8 1 S -(27-1):(27-1) US 0:(28-1) short int 16 2 S -(215-1):(215-1) US 0:(216-1) long int 32 4 S -(231-1):(231-1) US 0:(232-1) float 32 4 S -(231-1):(231-1) US 0:(232-1) double 64 8 S -(263-1):(263-1) US 0:(264-1) long double 80 10 S -(279-1):(279-1) US 0:(280-1) long long int (C99) 64 8 S -(263-1):(263-1) US 0:(264-1) 2015 All Copyrights Reserved © Mostafa Ali 7

×