Karteikarten
Module 4: C Programming
Karten in diesem Stapel (24)
- 1PreprocessorStrips everything that makes source file readable by humans (e.g. comments), and presents most basic code to the parser.
- 2ParserChecks that the code makes sense (lexical analysis) and determines actions that need to be taken.
- 3Code generatortranslates code into assembly language but doesn't assign physical addresses to hardware
- 4Variable syntaxData type - qualifier - name
- 5Variable exampleint long hello!
- 6floatFloating point (decimal)
- 7charliteral character (one character) - e.g. 'a' or '7' - stored as ASCII value
- 8#definePreprocessor directive - variable not stored in memory
- 9Increment "x"x++
- 10while loop that increases i until i=5int i=0
while ( < 5)
{ printf("Heyo",i++);} - 11continuecauses program to jump back to beginning of loop
- 12Multiply functionint Mult(int x, int y)
{ return (x*y); } - 13Array containing 10, 20, 30int array[2] = {10, 20, 30};
- 14Why use data pointer?we sometimes want to deal with variable's addresses (rather than their values)
- 15what does pointer do?holds address of another variable
- 16pointer syntaxtype *ptrname
- 17Create pointer "pointer" to numberint *pointer
- 18initalize pointer "p" to address "x"p = &x;
- 19"&" symbol (pointer)address of
- 20access element "2" of array "array"array[2]
- 21access element "2" of array "array" using pointerp = &array[2]
- 22Set PORTC as outputTRISC = 0x00000000;
LATC = 0b11111111; - 23Function (definition)self-contained code segments that perform a specific task
- 24create function "Mult" with two integer variable "a" and "b"int Mult(int a, b)
{ }
Informationen
- Beschreibung
- ELE2303 Embedded Systems Design Karteikarten am Module 4: C Programming, erstellt von Kyan Clay am 09/03/2016.
- Erstellt von
- Kyan Clay
- Aufrufe
- 2
- Bewertung