Upload files to "file"
This commit is contained in:
parent
c3243a252f
commit
3039a35fe5
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue