FILE * fopen(const char *filename, const char *mode);
int fclose (FILE *fp);
int fcloseall();
int fputc(int c, FILE *fp);
int fprintf(FILE *fp, const char *format [, arguments]);
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
int fgetc(FILE *fp);
int fscanf(FILE *fp, char *format [, arguments]);
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
void perror(const char *meldung);
#include <stdio.h>
#include <stdlib.h>
int main(void) {
FILE *fp;
fp = fopen("keinedatei.dat", "r");
if (NULL == fp) {
perror("Kann nicht aus Datei lesen ");
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
char *strerror(int error_nr);
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
int main(void) {
FILE *fp;
fp = fopen("keinedatei.dat", "r");
if (NULL == fp) {
fprintf(stderr, "%s\n", strerror(errno));
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}