Read And Store Each Line Of A File Into An Array Of Strings | C Programming Example

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

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

This code can be used in tons of applications in embedded design, it is amazing how software and hardware can talk to each others and achieve great things. Thank you Kevin.

fifaham
Автор

i spent hours figuering out how to do that unsuccessfully until watching this. thanx!

adto
Автор

wow the explanation was super good, I'll stay tuned for the dynamic version, and thank you very much for leaving the source code explained!

Nunok
Автор

You are a god send. You made this 100x easier than my professor

emanuelmaya
Автор

Is there a way i can differenciate between %s and %d like in fscanf(), i mean like in your example so i can then take "Line" and "1" and put them in another variables to use the somewhere else instead of the whole line as %s?

Thanks for the great explanation 🌷

muhamedhashim
Автор

Hi, this doesn't work for me. Copied code line for line. It will print all the lines, except for the last line where it outputs "Segmentation fault (core dumped)". Any ideas

qwackyy
Автор

Hi..Great video..but if we want to do this for struct of for example name and age ..do you have a video for that?

artaghorbani
Автор

hi, I have to do this but with a file with a typedef struct(contains all variables int) and store the records from the file to the array wich is the same struct of the file, could be same but with fread instead of fgets?, or I need something else?

luciano
Автор

how would you count the number of chars in each of the individual words

AnnaScott-bwbx
Автор

what if I want to store the string "Line" in an array and the number "1" in a separate array?

omarwalid
Автор

Hello, thank you for your explanation! But there is one thing that is not clear to me.... How can I read letter by letter each of the sentences that have been read from the file? Thanks!

naokigonzalez
Автор

So if i want to use the array, what should i do to use the array? I mean like the variable to call the array

torakadira
Автор

Do you know how to put a file with multiple lines sentences and place each words
Like do you have to 3 array

sansayangajanithy
Автор

What would you do if you wanted to input this data in a struct that has properties of char[] textbeforelinenumber, int linenumber? I understand how to get the strings from a file but I have a file that has ints I want to do something with afterwards.

TheHartemisPvP
Автор

Great video. Have you got a link to the dynamically allocated example?

Yanner
Автор

[Error] 'MAX_LINES' undeclared (first use in this function)

dmusic