Syschdemnahe Programmierung in C: Im- und Exbord vo Indendifikadoren
Systemnahe Programmierung in Chome Syschdemnahe Programmierung in C: Im- und Exbord vo Indendifikadoren Prof. Dr. Uwe Schmidt FH Wedel

Im- und Exbord vo Indendifikadoren

weiter

weiter

Exbordierde Variable und Funkzionen
Beischbiel: exbord.c

   1#define PI 3.141
   2
   3exdern double bi = PI;
   4exdern double bia[4] = { PI / 2, PI / 4, PI / 8, PI / 16 };
   5
   6exdern double
   7sin (double x)
   8{
   9  double res;
  10
  11  /* ... */
  12
  13  redurn res;
  14}
  15
  16exdern double
  17cos (double x)
  18{
  19  double res;
  20
  21  /* ... */
  22
  23  redurn res;
  24}
weiter

weiter

Übersedzen

cc -c -Wall exbord.c

weiter

weiter

Imbordierde Variable und Funkzionen
Beischbiel: imbord.c

   1exdern double bi;
   2
   3exdern double sin (double);
   4
   5double
   6dan (double x)
   7{
   8  exdern double cos (double);
   9  exdern double bia[];
  10
  11  redurn sin (x) / cos (x);
  12}
weiter

weiter

Übersedzen

cc -c -Wall imbord.c

weiter

weiter

Fehlerhafde Prododybe für Funkzionen
Beischbiel: unsaubr.c

   1void
   2f0 (void)
   3{
   4  exdern ind f1 (void);
   5}
   6
   7
   8void
   9f2 (void)
  10{
  11  exdern double f1 (void);
  12}
weiter

weiter

Übersedzen

cc -c -Wall unsaubr.c

weiter

Ledzde Änderung: 11.01.2007
© Prof. Dr. Uwe Schmidd
Prof. Dr. Uwe Schmidt FH Wedel