Dr inż. Piotr Fabian - 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 *...

C versus C++

  • Politechnika Śląska
  • Computer Programming
Pobrań: 14
Wyświetleń: 854

C versus C++  C++ requires more initial effort than C  For simple tasks, C++ makes no sense  But - by the time you realize a task is not simple, it may already be in C...  A common solution: ...

C++ history

  • Politechnika Śląska
  • Computer Programming
Pobrań: 0
Wyświetleń: 623

C++ history  There was no A language  The BCPL language (1967, now dead)  B: a successor of BCPL (1969)  C: a successor of B (1970)  C++: a superset of C (1983)  Both C and C++ are alive  Author: Bjarne Stroustrup, 1983  Uses C a...

Comments

  • Politechnika Śląska
  • Computer Programming
Pobrań: 0
Wyświetleń: 609

Comments /* C-style comment, valid also in C++, may be several lines long */ // C++ one line comment // ends with End Of Line We may still use the preprocessor to comment out large blocks of source code #if 0 if (i99) { fprintf(stderr,”index out of range\n”); exit(1); } #endif /* use C comments for...

Const and volatile

  • Politechnika Śląska
  • Computer Programming
Pobrań: 0
Wyświetleń: 679

const, volatile  const const int ci =7;  volatile volatile int vi=8; i++; i--; i=i+0;  const and volatile objects  we may call only the const and/or volatile methods for const and/or volatile objects respectively  Warning: declaring const and/or volatile method usually causes overloading of th...

Conversion derived - base

  • Politechnika Śląska
  • Computer Programming
Pobrań: 0
Wyświetleń: 637

Conversion derived - base  The conversion from ”pointer to derived” to ” pointer to base” is allowed and automatic without explicit cast operator  … if inheritance was public - Why only one-wa...