Technische Hochschule Würzburg-Schweinfurt (THWS)

Skip to content
Snippets Groups Projects
Commit 22cb7084 authored by Peter Braun's avatar Peter Braun
Browse files

Initial

parent 0e2b0c83
No related tags found
No related merge requests found
ex01.c 0 → 100644
#include<stdio.h>
int main() {
char data[20];
FILE *file;
int i=0;
char c;
file = fopen( "demo.txt", "rt" );
if( file == NULL ) {
printf("Datei 'demo.txt' existiert nicht\n");
return 1;
}
while( (i+1)<20 && (c = fgetc(file)) != EOF ) {
data[i++] = c;
}
data[i] = 0;
printf("%s\n",data);
fclose(file);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment