How to read a text file line by line in C Programming

preview_player
Показать описание
In today's video you will learn how to read a text file in C Programming language. I will use fopen and fgets functions to read strings from the file line by line.
Рекомендации по теме
Комментарии
Автор

Thanks for the tutorial! Any suggestions on how to replace the spaces in the file we read with another char like '#' or '%'?

mutantengineer
Автор

Is this a good way to add a ascii banner at launch? Ty

marcoaltomare
Автор

Hello brother. I have a question.Why the hack do we use fgets() function as a parameter of while loop. I am trying to find that out. Please respond me. I liked your video thank you so much

emirhandemir
Автор

How can you read, the student id, first name, and last name from a file?

musondaben
Автор

I pulled the "log" bar down and now I can't open it again in Codeblock. Does anyone have any help?

TungNguyen-sfes
Автор

Sir how to red full data in c programming or c ++

tusharnetale
Автор

And how i could read just the first number( code ) if i take every line and split it to more than word with a semicoloumn for example
If i have this format in my file :
Code; lastname; mark
1; firstlasname; 16.9
2;secondlastname;17.9
...
.
.
.
.
n; nemelastname;13.7

xghimhg
Автор

Hello, i want the read the file line by line and compare these lines and write the same lines to another file how can i do that?

emrecan_er
Автор

How do you store them in an array and access them

anselmos_brain
Автор

You didn't read the file line by line, you simply read the entire file and stored it in a string.

paulwin
Автор

how to remove the "next line", to get
Hi, This is line 1. Hi, this is line

huihui