Reading from text files in C

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Man i've been seeing your videos from like 5th semester, did a project because of u :) and still watchin !!!

hasnat_malik
Автор

It might be a REAL GOOD IDEA to post the code

escapefelicity
Автор

Is there a way to read just one line from a file without using fgets?

Автор

I always get segmentation fault and returns 1 when you check if(in == NULL). What should I do?

ELKondrado
Автор

Can you help me with this please:
Write a program that describes the work of a buffer between two processes, one writes in the buffer and other one reads from the buffer. Buffer size is fixed and must not be passed

najlaizeldin
Автор

why do you have fclose twice? one within the if statement and once just after? if the file is closed then how does it read from it? Thanks

craigkinney
Автор

If you want to store the data to a variable and then do some work on the data, how do you do that? for example, your file might look like this:
36 1 75 60 37 22
46 79 100 88 24 38
75 58 23 99 14 8
65 88 50 38 2 64
81 57 14 32 46 93
68 73 8 66 97 44

Now I might want to read this data line by line and number by number so that I have:
A=36
B=1
C= 75
D= 60
E= 37
F=22

Now do something with the numbers and then move to the next line and so on until I reach the EOF.

Now how can I do this in C? In C# it is pretty easy because it has functions/Methods to do these things but in C it looks quite difficult. However, with your expertise you can tell us how this done.

Please write a blog or create a short video so that we can follow it.

Thanks for these very helpful videos.

Kind regards,

johnali
Автор

is it possible to pass a variable with the name of the file to the function fopen_s as the second parameter? If so, how to do it?

YukinobuTatsu
Автор

Can u please do the same video but using functions

mongraal
Автор

Great tutorial! is serialization and the process of bringing in data the same as encapsualtion?

tynanmcgrady
Автор

How do you choose which line you want to read at ?

ripjou