Upload files to "file"

This commit is contained in:
Vichingo455 2025-03-12 09:47:37 +00:00
parent c3243a252f
commit 3039a35fe5
1 changed files with 23 additions and 0 deletions

23
file/prova_file.cpp Normal file
View File

@ -0,0 +1,23 @@
/*
AUTORE: Manuel Vichi
Prova file
*/
#include <iostream>
#include <cstring>
#include <cctype>
#include <cstdlib>
using namespace std;
int main(void){
FILE *fp = fopen("file.txt","r");
if (fp != NULL) {
int ch;
while((ch = fgetc(fp)) != EOF)
cout << (char)ch;
// cout << endl;
fclose(fp);
} else {
perror("Errore: ");
return 1;
}
return 0;
}