ras le bol

This commit is contained in:
2026-02-23 01:15:30 +01:00
parent fba51abae3
commit 28dee070b3
38 changed files with 442 additions and 321 deletions
@@ -1,6 +0,0 @@
First line
Second line
Third line
and so on
^^^ Even empty lines ^^^
@@ -2,33 +2,39 @@
int print_lines(const char *filename){
FILE *file = fopen(filename);
FILE *file = fopen(filename, "r");
if(!file) return 1;
// int c = fgetc(file);
int c = fgetc(file);
while(c != EOF){
while(c != '\0') printf("%c", c);
printf("%c", c);
c = fgetc(file);
/*
while(c != '\0'){
c = fgetc(file);
printf("%c", c);
}
printf("\n");
*/
}
return 0;
}
/*
int main()
{
print_lines("example.txt");
/* Expected:
> First line
> Second line
> Third line
> and so on
>
> ^^^ Even empty lines ^^^
*/
// Expected:
// > First line
// > Second line
// > Third line
// > and so on
// >
// > ^^^ Even empty lines ^^^
return 0;
}
*/