C Programming Tutorial 68, Reading From Files pt.1

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

you are better than my programming teacher

flowdyofficial
Автор

Because he was reading individual characters, not entire lines. He used fgetc() to fetch one character at a time, looping until the EOF was reached. He could also have read in an entire line using fgets(), and then printed that out using %s. Of course he would have needed some sort of a string (character array or char*) type to accept it.

tcbetka
Автор

very good way of tutoring, thank you man.

castro
Автор

The only tutorial that worked for me
Thank you

akiraxoxo
Автор

thanks a ton for the tutorials you are doing a great service .for C++ tutorials which channel is the best.?

yogeshballari
Автор

that was useful to me, i'm learning java and android but i did understand this tutorial, thanx man

barshawi
Автор

For beginner stuff, thenewboston is good, for more advanced stuff I'm not really sure, just look for college lectures. They're usually pretty good.

iTzAdamX
Автор

thank you very much, very clear and helpful

Автор

thank you .. finally i get solve my problem

mribrahim
Автор

I believe what he is trying to say is that whether or not is a FILE registered keyword (like int, bool etc.).

PrfixProducts
Автор

is the word FILE *file is a const and special word in C the word FILE?

thewhisperinyourears
Автор

It might be a REAL GOOD IDEA to post the code

escapefelicity
Автор

Adam does C is being developed yet or is stopped? because this fopen \\ issue coul dbe fix! you would not use a escape character inside a fileopen function no logic behind that right? so the question is is C being developed yet?

thewhisperinyourears
Автор

i guess at the end of the 1st line the fgetc gets '\n' which breaks the line in the output

seal
Автор

I'm not exactly sure what you mean, but FILE is not a primitive type.

iTzAdamX
Автор

This is **wrong, ** the char type cannot represent the EOF value. That's why "fgetc()" returns an int. You **absolutely must** use an "int" too.

HCOSzifon
Автор

Why are you treating the sentences in the file as a %c and not %s when you looping through it?

thewhisperinyourears
Автор

it doesn't output something in my screen like the 'C' it's just a blinking underscore sign. Btw I also copied the "C is really fun.
and c# is also a good language." in a .txt file on my desktop . Hope someone can help me :)

zacknsemblem
Автор

anyone else hear that annoying cricket?

KamiSama