Fundamentals of Computer Programming - strona 4

note /search

The alphabet - overview

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

The alphabet Both the basic source and basic execution character sets shall have at least the following members: • the 26 uppercase letters of the Latin alphabet: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z • the 26 lowercase letters of the Latin alphabet: a b c d e f g h i j k l m n o p q ...

The Julian and Gregorian calendars

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

The Julian and Gregorian calendars • The true length of the year: 365.242189 days • The mean length of the year in the Julian calendar (used before 1582): 365.25 days (1 leap year every 4 years) • There is a difference of 0.007811 days • What to do with the a difference of 0.007811 days • Remove 3 ...

Type conversions - overview

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

Type conversions • Problem: different types of operands • Solution: conversion to a common type according to a small number of rules. double x, y; int k; y = x + k; • The only automatic conversions are those that convert a ''smaller'' operand into...

Ungetc - overview

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

Ungetc Pushes a character back i nto input stream int ungetc(int c, FILE *stream); • Pushes the character c back (!) to the input stream, which must be open for reading • This character will be returned on the next call to getc or fread for that stream • One character can be pushed back • A second ...

Unions - overview

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

Unions • A union - holds objects of different types and sizes(at different times) • May be used to save memory • The compiler takes care about alignment of objects in memory • Syntax: similar to structures union u_tag { int ival; float fval; char *...

A simplified copying program

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

A simplified copying program #include #include #define PERMS 0666 /* RW for owner, group, others */ /* cp: copy f1 to f2 */ int main(int argc, char *argv[]) { int f1, f2, n; char buf[BUFSIZ]; if (argc != 3) fprintf(stderr,"Usage: cp from to"); if ((f1 = open(argv[1], O_RDONLY, 0)) == -1...

ANSI C Translation Phases

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

ANSI C Translation Phases  Every trigraph sequence in the source file is replaced  Every backslash/new-line character pair is deleted  The source is converted into preprocessing tokens and sequences of white spaces  Each comment is effectively replaced by a space character  Every preprocessing...

Conditional Inclusion

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

Conditional Inclusion  The #if line evaluates a constant integer expression  If the expression is non-zero, subsequent lines until an #endif or #elif or #else or #elifdef or #elifndef are included  The expression defined( name ) in a #if is 1 if the name has been defined, and 0 Otherwise 

Functions in C99

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

F unctions in C99  acosh  asinh  atanh  cbrt  copysign( x , y )  erf  erfc  exp2( x )  expm1( x )  fdim( x , y ) inverse hyperbolic cosine inverse hyperbolic sine inverse hyperbolic tangent cube root returns the value of x with the sign of y error function complementary error function rai...

Line buffered input

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

Line buffered input  Each line input is stored in a buffer  Problems can arise when a program does not process all the data in a line, before it wants to process the next line of input  Consider the following code: int x; char st[31]; printf(&qu...