Fundamentals of Computer Programming - strona 14

note /search

Structures - overview

  • Politechnika Śląska
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 476

Structures • A structure - consists of a sequence of named members of various types • struct starts a structure declaration (a list of declarations enclosed in braces) • An optional name called a structure tag may follow the word struct • Access: struct-name.member •

The complete set of escape sequences

  • Politechnika Śląska
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 385

The complete set of escape sequences \a alert (bell) character \\ backslash \b backspace \? question mark \f formfeed \' single quote \n newline \" double quote \r carriage return \ ooo octal number \t horizontal tab \x hh hexadecimal numbe...

The if statement - overview

  • Politechnika Śląska
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 336

The if statement • The general form is if ( expression ) statement1 else statement2 • One and only one of the two statements associated with an if-else is performed • If the expression is: - true, statement1 is executed; - if not, statement2 is executed. • Each statement can be a single statement o...

The switch statement

  • Politechnika Śląska
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 546

The switch statement • Syntax: switch ( expression ) { case const-expr : statements case const-expr : statements default: statements } • Example: switch (c=getchar()) { case '0': printf("Zero...

The ternary operator - overview

  • Politechnika Śląska
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 364

The ternary operator ?: • Syntax: expr 1 ? expr 2 : expr 3 • The expression expr 1 is evaluated first • If it is true (not 0), then the result is equal to expr 2 • Otherwise expr 3 is evaluated as the value • Only one of expr 2 and expr 3 is evaluated •

Tmpfile - overview

  • Politechnika Śląska
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 455

Tmpfile • Creates a temporary file. FILE *tmpfile( void ); • creates a temporary file and returns a pointer to that stream • The user does not specify / know the name of the file • NULL if error • The file is automatically deleted when: - the file...

Unicode - overview

  • Politechnika Śląska
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 469

Unicode • ASCII does not cover characters from all languages • „ Standards” - only a partial solution • Solution: Unicode • Unicode is a computing industry standard for the consistent encoding, representation and handling of text expressed in most of the world's writing systems • More than 109,000 ...

Variables in memory - overview

  • Politechnika Śląska
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 525

Variables in memory • Each variable is stored somewhere in the memory • The address of a variable is the index of the first memory byte where the variable is stored • The number of bytes occupied by a variable depends on its type and the system; ch...

Very big integers - overview

  • Politechnika Śląska
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 441

Very big integers: long long int • Available in some systems • Usually 64 bits long • Range: - -9223372036854775808 .. 9223372036854775807 (signed) - 0 .. 18446744073709551615 (unsigned) • Printing with

Assert

  • Politechnika Śląska
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 455

 void assert(int expression ); - Macro used to add diagnostics. - If expression is false, message printed on stderr and abort called to terminate execution. Source file and line number in messag...