Fundamentals of Computer Programming

Assigning names to structure types

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 7
Wyświetleń: 2387

Assigning names to structure types typedef struct { float re, im; } tcompl; tcompl a, b, c; a.re = 10.5; a.im = 36.6; b = c = a; ...works like: struct compl { float re, im; }; struct compl a, b, c; a.re = 10.5; ... or: struct { float re, im; } a, b, c; ...

ASCII - omówienie zagadnienia

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 7
Wyświetleń: 2282

ASCII • The American Standard Code for Information Interchange • Acronym: ASCII • Pronounced: /'æski/ ASS-kee • A character-encoding scheme based on the ordering of the English alphabet • ASCII codes represent text in computers, communications equi...

Bitwise AND - omówienie zagadnienia

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 21
Wyświetleń: 2422

Bitwise AND • Operates on integers • Example: 108 0 1 1 0 1 1 0 0 & 217 1 1 0 1 1 0 0 1 = 72 0 1 0 0 1 0 0 0 ...

Breaking loops - examples

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 2380

Breaking loops • It is possible to exit from a loop in other way than by testing the condition • The break statement exits from for , while , and do (and switch ) • A break causes the innermost enclosing loop or switch to be exited immediately ...

All printf conversion specifications

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 861

A ll printf conversion specifications Character Argument type; Printed As d,i int; decimal number o int; unsigned octal number (without a leading zero) x,X int; unsigned hexadecimal number (withou...

Bit fields - omówienie zagadnienia

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 749

Bit-fields • Used to store variables smaller than one byte • Example: - a set of single-bit flags - interfaces to hardware devices • The usual way: masks, shifting, masking, ... • An alternative in C: bit-fields • A bit-field , or field : a set of...

C Compilers - examples

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 7
Wyświetleń: 882

C/C++ compilers • Turbo C++ Explorer • Free Microsoft Visual C++ 2010 Express • Free Microsoft eMbedded Visual C++ • Free Microsoft .NET Framework Software Development Kit / Free Microsoft Visual C++ Compiler • Open

Constants - examples

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 875

Constants • An integer constant like 2345 is an int • long constant is written with a terminal l or L : 1L • Unsigned constants are written with a terminal u or U ( ul means unsigned long) • A leading 0 (zero) on an integer constant means octal • ...

Control flow while loop

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 651

Control flow: the while loop while (condition) { instruction(s) } • The condition in parentheses is tested. • If it is true , the body of the loop (statements enclosed in braces) is executed. • Then the condition is re-tested, and if true, the body is executed again. • When the test becomes false ,...

Counting digits - examples

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 658

Counting digits #include /* count digits, white space, others */ int main() { int c, i, n_white, n_other; int n_digit[10]; /* 10 counters for 10 digits */ n_white = n_other = 0; for (i = 0; i = '0' && c (…) …; printf("digits: "...