C Programming Tutorial # 41 - fscanf() - feof() - Reading From A File - Part 1 [HD]

preview_player
Показать описание
In this tutorial we learn how to read from a file. We also learn how to detect that we have reached the end of file and that there is no more data to read.

This tutorial is part of the following series:
Рекомендации по теме
Комментарии
Автор

why did you decide to go with the name "joe" instead of something more traditional like Ravikkumar or Sivanthanan

TmacRockets
Автор

you didnt explain feof even tho its in the title

jarrettmaier
Автор

This is great episode of tutorial. It is very easy to understand how everything works.
I am just woried it is one of last episodes :)
Please make more videos, they are priceless for a someone like me, who want to learn by self.

AutoRijeka
Автор

@Asmik20112011 This is more of a convention. All the variable names represent the contents of the variables except arrays whose names represent the address of the first element of the array. Now fscanf() always needs an address as the argument or parameter. So if you are passing an integer you have to use & to pass the address of the integer, but if you are passing an array or a string then all you need to do is to pass the name of the array and that would serve as the address.

Learnorama
Автор

Thank you, it was a great help for me :)

shamsiize
Автор

Please, explain, why the second argument of fscanf () should be an address of the variable "score" and not just the name of this variable?? (At the same time, to read the string "Joe" into "name" you don't give its address, you give just the variable name..)

Asmik
Автор

why do we need sign " & " before variable score ?

tunamusic
Автор

i have yet to see a tutorial that explains how to use [ ^ ] \n etc etc to real a more complicated file

EnjoyTheBeautifulLife
Автор

@Learnorama Thank you so much for the answer. And your C Prog tutorials are really a great job. Thanks.

Asmik
Автор

it seems correct when ive seen it being done in the video .. but i did the same exact thing and it said "could not open the file ."

Van-ci
Автор

how do i read 1 line at a time and pause at each line for question & answer
program and print to the screen in c++

if(x ==1)textview01.setText(" Alabama pop.4, 661, 900")
if(x ==2)textview01.setText(" answer 1819 Montgomery pop.202, 124")
if(x ==3)textview01.setText(" Alaska pop.686.293")
if(x ==4)textview01.setText(" answer 1959 Juneau pop.30, 988")
if(x ==5)textview01.setText(" Arizona pop.6.500.180")
if(x ==6)textview01.setText(" answer 1912 Phoenix pop.1, 601, 587")


immygran
Автор

open/close/read/write... just perfect...
how do i update the data once written in the text file?
Please help!

kanti
Автор

first of all where to save the file to be read ? I tried everything to make it read. it doesn't read the file at all...some please help me @CPlusPlus TutorDotcom

vigneshwarankannan
Автор

Great video but didn't explain feof which was the reason I wanted to watch it; would recommend changing the title of the video. Otherwise, a good video!

lindawisebear
Автор

why is it in c++? the title says c, or is there no difference to the syntax? thank you

CarlNathanII
Автор

great vids, when i make this program its only prints one word, in the text if theres a space it wont print it, how do i do this??, so its prints out like this

dog cat tim bill fine ect

aman
Автор

but how to print a whole line from file using fscanf().

dipankar
Автор

Good stuff, but why doesn't C require you to add an ampersand symbol in front of "name" like you needed for "score"?

JossinJax
Автор

how do I use a loop to read characters on a text instead of doing it one by one?

tadm
Автор

His computer b like league of legends after pressing y

MaxRollison