Skip to Main Content
C – kurz & gut, 2nd Edition
book

C – kurz & gut, 2nd Edition

by Ulla Kirch-Prinz, Peter Prinz
September 2019
Intermediate to advanced content levelIntermediate to advanced
176 pages
3h 32m
German
dpunkt
Content preview from C – kurz & gut, 2nd Edition

C-Sprachbeschreibung

Grundlagen

Ein C-Programm besteht aus einzelnen »Bausteinen«, den Funktionen, die sich gegenseitig aufrufen.

/* Head.c: Das Programm gibt den Anfang einer *

* Textdatei auf die Standardausgabe aus. * Kommentar

* Aufruf: Head Dateiname */

#include <stdio.h> Präprozessordirektiven

#define LINES 22

void showPage( FILE *); // Prototyp Deklarationen

int main( int argc, char **argv) Die Funktion main()

{

FILE *fp; int exit_code = 0;

if( arge != 2 )

{

fprintf(stderr, "Aufruf: Head Dateiname\n");

exit_code = 1;

}

else if( (fp = fopen(argv[1], "r")) == NULL )

{

fprintf(stderr, "Fehler beim Öffnen der Datei!\n");

exit_code = 2;

}

else

{

showPage(fp);

fclose(fp);

}

return exit_code;

}

void showPage( FILE *fp) // Eine Bildschirmseite ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Betriebssysteme, 4th Edition

Betriebssysteme, 4th Edition

Eduard Glatz
Mathematik

Mathematik

Bernd Ulmann

Publisher Resources

ISBN: 9781098123628