Lecture 27 Reading from a file in C Language Hindi

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ธ.ค. 2024

ความคิดเห็น • 123

  • @vikasmenghani2477
    @vikasmenghani2477 4 ปีที่แล้ว +24

    Note:- while loop only run when condition is true(means outcome should be 1 ) and in "feof" function gives all the time output 0 till the end of the file ,so ( ! feof gives all time output 1 and at the end of file gives output 0 and we know that while loop stops at 0 ,so while loop stops at end )
    I hope this explanation would helpful to you😊

  • @fizzbuzz6
    @fizzbuzz6 2 ปีที่แล้ว +1

    Sir u r like a god for us
    Your way of teaching is awesome and u r providing all this content for free..thank you sir
    For helping me and those who are financially weak

  • @joyh4
    @joyh4 5 ปีที่แล้ว +3

    Sir I know a very little hindi but I can understand all your lectures.
    You teach in a very easy way that a donkey wound understand. You are a genius.

  • @sachingoel7790
    @sachingoel7790 7 ปีที่แล้ว +17

    Its a greatest effort to teach student by E-medium. Your are not going very fast , with diagram method is too good ,so that a novice student can understand it easily. ( I am doing MCA after B.com and your videos are helping me without any cost). Cheer -full. I am also a subscriber.

    • @lonewolfmohit
      @lonewolfmohit 4 ปีที่แล้ว +1

      Sir meri file open nhi ho rhi hai kya karu.

    • @pranaysharma02
      @pranaysharma02 3 ปีที่แล้ว +1

      @@lonewolfmohit file phle bnaye ho? Check krlo ekbaari

    • @suyashkumar8840
      @suyashkumar8840 3 ปีที่แล้ว

      Sachin bro please provide your insta account I want to ask something from u

  • @vakhariyajay2224
    @vakhariyajay2224 2 ปีที่แล้ว +1

    Thank you very much. You are a genius. 👍👍🔝🔝🙏🙏👌👌

  • @abhisekmishra5245
    @abhisekmishra5245 6 ปีที่แล้ว +11

    your explanation way make you unique sir ☺

  • @Viral_Meme3499
    @Viral_Meme3499 5 ปีที่แล้ว +3

    Sir i have noticed that when you wrote file type variable instead of pointer ....
    Thank you so much sir for providing such knowledge for free...

  • @sheetaljain4288
    @sheetaljain4288 5 ปีที่แล้ว

    really sir my concept is being clear one by one after seeing your video ,i am very grateful to you .....thank you thanks you thanks you so much

  • @HeiStMP
    @HeiStMP 4 ปีที่แล้ว +1

    thank you sir , these videos help me to learn whole c language

  • @rahulsoni353
    @rahulsoni353 4 ปีที่แล้ว

    Thankuu sir aapki aawaj me jadu hai ,, aap bhut achhe se btate hai ,,,

  • @muradali7360
    @muradali7360 10 หลายเดือนก่อน +1

    Thankyou so much sir from ❤❤❤❤❤❤ se

  • @psychology1649
    @psychology1649 5 ปีที่แล้ว +1

    Great work sirr genuine teacher

  • @SalimShaikh-qp7zl
    @SalimShaikh-qp7zl 4 ปีที่แล้ว

    Sir, ap jo parate age piche sochke parate hai sir , esme concept bahut achcha create hota hai

  • @shyamkachhadiya4964
    @shyamkachhadiya4964 6 ปีที่แล้ว

    nice explained,i have cleared that file in one try awesome

  • @rajukumar904
    @rajukumar904 4 ปีที่แล้ว

    Thanku so much sir
    I get this concept
    U r the best 🙏🙏

    • @lonewolfmohit
      @lonewolfmohit 4 ปีที่แล้ว +1

      Bhai meri file open nhi ho rhi hai

  • @karanvedi6779
    @karanvedi6779 3 ปีที่แล้ว

    Thankyou very much sir,,,, 🙏👍

  • @julisharma9562
    @julisharma9562 5 ปีที่แล้ว +1

    Very nice sir

  • @shudhanshugupta439
    @shudhanshugupta439 5 ปีที่แล้ว

    Sir u r the best , really

  • @ankurkumar-bn4xd
    @ankurkumar-bn4xd 5 ปีที่แล้ว +3

    Sir, aap god hai mere liye... Kuki clg me kya padhate kaise padhate hai wo mujhe samjh nhi aata hai.

  • @extremetech5854
    @extremetech5854 5 ปีที่แล้ว +1

    Sir mujhe windows ke folder me rakhi file copy karni hai use kaise likhe ge fopen ke andar

  • @swayamprakashsahoo9002
    @swayamprakashsahoo9002 4 ปีที่แล้ว +1

    Sir,
    U tought well bt i could not understand how while loop works here...... How while loop stops

  • @shubham-pm8qx
    @shubham-pm8qx 5 ปีที่แล้ว +2

    Sir is there any way through c program to read .xls(excel file reading)??

  • @authenticworld7271
    @authenticworld7271 4 ปีที่แล้ว +2

    sir,
    if we don't know which type of data already store in file then how we can use char ch;
    data may be int type or anything else.
    and i'm not clear about while(!feof(fp)); that statement... why we are using !, and if we are using this loop for read entire data so why we are not using before..
    i know you are so busy... if you have time then please sir clear my doubt... GOD bless you & your family member also... your name also in list of my favorite teacher...
    thank you sir...

    • @nishchaybhokare2858
      @nishchaybhokare2858 4 ปีที่แล้ว

      Yes brother I also have same doubt abou !feof(fp)
      But why there is use !
      If you know plz reply

    • @baqirjafri2388
      @baqirjafri2388 4 ปีที่แล้ว +1

      @@nishchaybhokare2858 it is predefined function and this - ! use here to specify that loop will work until it not reaches end of file ....if end reaches means function return false and will come out of loop

    • @nishchaybhokare2858
      @nishchaybhokare2858 4 ปีที่แล้ว

      @@baqirjafri2388 thanks brother

  • @Drdhaval87
    @Drdhaval87 5 ปีที่แล้ว +14

    sir ido not understand how (!feof(fp)) will return true(1) or false(0)??

    • @sohambhattacharjee28
      @sohambhattacharjee28 2 ปีที่แล้ว +3

      feop(fp) returns 0(false) when it doesn't encounter end of file and returns 1(true) when it encounters end of file. Now, "!" is logical not operator. So, !(feof(fp)) will imply true, when it is 0 and will imply false, when it is 1. So, while(!feof(fp)) will execute till (!feof(fp)) becomes 1, because 1 will imply false, and simultaneously conditon for the loop also becomes false.

  • @arindamsarkar672
    @arindamsarkar672 6 ปีที่แล้ว +2

    I don't understand which pointer is pointing the replica of actual File?..*curp or *buffer...I have confusesion between them

  • @naveenjain1597
    @naveenjain1597 6 ปีที่แล้ว +1

    @12.52 could we have written "ch=fgetc(fp)" just after while loop eliminating the need to write it before while?

  • @anshumanpurohit4278
    @anshumanpurohit4278 ปีที่แล้ว

    sir FILE data type agar struct ki madad se bana hai toh fir woh toh user defined data typr hona chahiye na ?

  • @100rabhish
    @100rabhish 7 ปีที่แล้ว +1

    sie feof wali line ki jagah---------> while((ch=fgetc(fp))!=EOF likh re hain to notepad me se adhe character read hoke aa rahe hain..jaise maine notepad me getc likha h to output screen pe sirf gt likh ke aa raha hai..aisa kyun aur isko kaise rectify karenge ?

  • @nitingupta8029
    @nitingupta8029 5 ปีที่แล้ว +1

    👍👍👍👍👍👍

  • @karanmaurya2216
    @karanmaurya2216 ปีที่แล้ว

    Thankyou sir ji 🙏

  • @happyhemantsingh8583
    @happyhemantsingh8583 3 ปีที่แล้ว +1

    Sound volume is very low in each and every video. Rest is great...

  • @ankurkumar-bn4xd
    @ankurkumar-bn4xd 6 ปีที่แล้ว

    Sir array, character and string, user defined function, structure and union, pointer, file management in c, dynamic memory allocation and linked lists and Preprocesser ka Topicwis video banayenge to sabhi logo ko bhut hi helpful sahit hoga.

  • @healthadvicebysatyamdubey4571
    @healthadvicebysatyamdubey4571 4 ปีที่แล้ว

    Sir aap allahabad kabhi ghumne aye hai

  • @chandantrivedi1247
    @chandantrivedi1247 5 ปีที่แล้ว +2

    I didn't understand why did we used
    ch=fgetc(fp);
    Again in while loop when it was already used right before while loop.pls explain.

    • @nahidafirdose9218
      @nahidafirdose9218 5 ปีที่แล้ว

      Coz..before while loop it got only one char which is printed once u have entered while loop...but only one char is not there in the txt file,so to print all the remaining chars fgetc()is used inside while loop..here u should note that we have not taken char array we just have taken char type variable so obviously it will store one char at a time and so it is must to use fgetc() again in while loop to get all chars one by one :)

    • @sankalpsachan9199
      @sankalpsachan9199 5 ปีที่แล้ว

      @@nahidafirdose9218 yaa he use before while loop also to explain this otherwise no need to write same line before while

    • @Goku-tt5hb
      @Goku-tt5hb 4 ปีที่แล้ว

      @@sankalpsachan9199 true

  • @thetrender6798
    @thetrender6798 4 ปีที่แล้ว

    Majja aa gaya

  • @Youandme1717
    @Youandme1717 ปีที่แล้ว

    Awesome

  • @anuragvikasmishra7799
    @anuragvikasmishra7799 8 ปีที่แล้ว +1

    Hi Saurabh jee,
    I am not sure why we are using fgetc method twice ,its giving the same result if I do not use it outside the while loop,Please explain the need of it outside the loop.

    • @jahanzaibnavi5887
      @jahanzaibnavi5887 8 ปีที่แล้ว +1

      Brother you are right,I think he did it intentionally to show it with both the methods,
      Outside one shows that it prints only 1 character and increment it to another, but if anyone wants to print it up to the end of file then it should be written in loop.

    • @techsapmadeeasy
      @techsapmadeeasy 6 ปีที่แล้ว

      Bro it gives extra space on output screen

  • @rajnish1002
    @rajnish1002 3 ปีที่แล้ว

    👏 👌 👍🏻

  • @harshjain4256
    @harshjain4256 4 ปีที่แล้ว

    Sir read mode me file ko close karne ki kya zaroorat hai bcz humne to data read karliya ab vo close ho ya na ho usse kya fark padta hai?

  • @RahulKumar-rx9rh
    @RahulKumar-rx9rh 6 ปีที่แล้ว +1

    sir whenever i m trying to use loop my code blocks stop responding..it resond as " your program has stopped working" i have written. the exact code of yours..this has happened to me many times..plz give some solutions

    • @ankitsinha9019
      @ankitsinha9019 4 ปีที่แล้ว

      Add text file in code bock and then run

  • @mechtoit6555
    @mechtoit6555 4 ปีที่แล้ว

    sir why code block is important

  • @asthagoel6177
    @asthagoel6177 5 ปีที่แล้ว +1

    What is the need of fclose() here?

  • @SahilSingh-js9oe
    @SahilSingh-js9oe 6 ปีที่แล้ว

    Thanks sir for dis video

  • @asthagoel6177
    @asthagoel6177 5 ปีที่แล้ว +2

    Sir,char ch van store only one character so ,how remaining character will store in char ch?

  • @girijendratripathi6850
    @girijendratripathi6850 3 ปีที่แล้ว

    thanku so much sir

  • @sohilmansuri3579
    @sohilmansuri3579 7 ปีที่แล้ว +5

    exit(1) kya he sir ?

    • @amansharma-ww7tv
      @amansharma-ww7tv 7 ปีที่แล้ว

      without using this exit function we can easily run the prog. so there is no use this exit function..

    • @ujjawalkumarsingh5298
      @ujjawalkumarsingh5298 6 ปีที่แล้ว

      If mentioned file name in fopen() function is not present in your file labrary Then exit(1) is work..

    • @piezero_567
      @piezero_567 6 ปีที่แล้ว +2

      iska matlab hai pure program sai exit kar jaiega only one-time

    • @Rajat_maurya
      @Rajat_maurya 5 ปีที่แล้ว

      Abnormal terminating of program

  • @bhindekaur2211
    @bhindekaur2211 4 ปีที่แล้ว

    thankyoy sir🙏

  • @amolacharya5342
    @amolacharya5342 7 ปีที่แล้ว

    Sir can't we open any existing word document? If so what extension do I have to use?

  • @techsapmadeeasy
    @techsapmadeeasy 6 ปีที่แล้ว

    Anyone? What is difference between getc() function and fgetc() function? we can aso use getc() function instead of fgetc() funtion.

  • @ranashaka5585
    @ranashaka5585 5 ปีที่แล้ว

    while using fscanf or may be in this case also, reading a string with spaces, gives error, don't know why, If u write a name of Book Harry Potter, means having a space between them, it shoots to infinity in my case....How can we read a file,having a string in it using fscanf??? while(fscanf(fptr,"%d/%d/%d %d %s %lld %s",&.......), you see two %s format specifier, if in file they have a name like Harry potter (having a space between ) ,in file, at the place of any %s, it will shoot to infinity???? Any solution....

  • @ansonalexander009
    @ansonalexander009 7 ปีที่แล้ว

    file is defined in stdio or stdlib?

  • @believeinpractical3930
    @believeinpractical3930 4 ปีที่แล้ว

    Nice

  • @aakansha5029
    @aakansha5029 7 ปีที่แล้ว

    How to read both text and integer from file ?

  • @AbhaySharma-fg6ch
    @AbhaySharma-fg6ch 4 ปีที่แล้ว

    Hello, Sir I want to ask that what is the need of 11th line as the respective work will be done by 14th line till the end of a file ?
    Can we remove the 11th line ?

    • @Goku-tt5hb
      @Goku-tt5hb 4 ปีที่แล้ว +1

      Bro , the work of action statement in 11th line is to get the first byte's character .
      And that of 14th line is to assign character of the next byte in the file , as pointer gets incremented so the next byte can be accessed further on

    • @AbhaySharma-fg6ch
      @AbhaySharma-fg6ch 4 ปีที่แล้ว

      @@Goku-tt5hb thanks bro

  • @sachingoel7790
    @sachingoel7790 7 ปีที่แล้ว

    Hi sir, I have write the above same code but my screen is not running or stop and can we use '\0' instead of type NULL because complier is not reading NULL. Please assist.

    • @mysirgdotcom
      @mysirgdotcom  7 ปีที่แล้ว

      use #include

    • @sachingoel7790
      @sachingoel7790 7 ปีที่แล้ว

      I have used #include my screen is run but for a second i am using getch also.

    • @anjalibala5371
      @anjalibala5371 6 ปีที่แล้ว

      Sachin Goel for getch () u need #include

  • @jeet7000
    @jeet7000 4 ปีที่แล้ว

    Bolo Jai mahakaal

  • @sachinsharma-dx6ms
    @sachinsharma-dx6ms 7 ปีที่แล้ว

    sir isame hum kisi or drive mai file bana to nahi sakte pr banani ho to kya kare sir. ????

  • @riyazsekh7715
    @riyazsekh7715 6 ปีที่แล้ว

    Sir kase pata chalega k file char return kr rahahe Kuch or v to return kr skta Hain?? Mtlb agr mujha pata Nahi Hain k file k ander kis type a data hain .

  • @shubhamkumarshaurya9326
    @shubhamkumarshaurya9326 3 ปีที่แล้ว

    where is the playlist of this video

  • @shubhpandey5228
    @shubhpandey5228 8 ปีที่แล้ว

    sir nested if else bhi add kr dijiye .. students ke liye help hoga ... Maine sare videos yha dkhe .. bt nested If else k liye .. or jgh jna pda ..because wo mere course me tha

  • @shubhamkumarshaurya9326
    @shubhamkumarshaurya9326 3 ปีที่แล้ว

    sir, how can i read an img file in c language plz anyone reply...if u know...it,s urgent

  • @brahmanandakabi8796
    @brahmanandakabi8796 3 ปีที่แล้ว

    Sir if you create through program it will not work

  • @rajnikantpyarelal6162
    @rajnikantpyarelal6162 6 ปีที่แล้ว

    Excuse me sir iska matlab file read karne ke liye humare pas allready ek file hona chahiye in my file but i don't know how to make a file ...please......say something abouts it...............

  • @amaansiddiqui734
    @amaansiddiqui734 4 ปีที่แล้ว

    ❤️❤️❤️

  • @dharmender1975
    @dharmender1975 6 ปีที่แล้ว

    if we cannot use fclose() than what will happen

    • @techsapmadeeasy
      @techsapmadeeasy 6 ปีที่แล้ว

      nothing in case of reading only.provided some conditions are there writen while reading.

  • @himanshusingh5118
    @himanshusingh5118 7 ปีที่แล้ว +1

    sir what is this:- (! feof (fp)) ??????

    • @mysirgdotcom
      @mysirgdotcom  7 ปีที่แล้ว +3

      it is a function to check end of file

    • @vishal_gadhave
      @vishal_gadhave 6 ปีที่แล้ว

      traverse the file unless n until it ends

  • @khansirgkquiz8715
    @khansirgkquiz8715 6 ปีที่แล้ว

    Thank u sir

  • @GunnuGilahari92
    @GunnuGilahari92 7 ปีที่แล้ว

    sir i am confuse in buffer and curp pointer .........

  • @b.kkanhaiya6181
    @b.kkanhaiya6181 4 ปีที่แล้ว

    is program me 1st character nhi aa paa rha hai?

  • @commas7430
    @commas7430 6 ปีที่แล้ว

    fgets() return int value

  • @rabinkumardadel6224
    @rabinkumardadel6224 3 ปีที่แล้ว

    Explation❤️❤️❤️🐒

  • @lonewolfmohit
    @lonewolfmohit 4 ปีที่แล้ว

    Sir Meri file open nhi ho rhi hai,kya karu.

  • @mitulmakwana1535
    @mitulmakwana1535 4 ปีที่แล้ว

    Sir i did not get results it seems that file id return

  • @shashankvashishtha4454
    @shashankvashishtha4454 4 ปีที่แล้ว +4

    Sir I found some people who download your videos and not watch it on TH-cam.
    Sir please a make video and scold them after all they are cheating you.
    Hit like button who agree with me.

  • @yugalkishore8991
    @yugalkishore8991 5 ปีที่แล้ว

    sir what is the location of file
    f1.txt

  • @besttimeofthisplanet4234
    @besttimeofthisplanet4234 6 ปีที่แล้ว

    thsnks..

  • @ashishsinha8893
    @ashishsinha8893 8 ปีที่แล้ว

    why u sir not include header files.........................sir

  • @thefuntech2810
    @thefuntech2810 6 ปีที่แล้ว +4

    Sir I not understand this command
    While(!feof(fp))..

    • @NikhilSingh-yo1ul
      @NikhilSingh-yo1ul 6 ปีที่แล้ว +3

      while(!feof(fp)).
      Mtlb jab tk end of file nhi aa jaata tb tk loop run karega

  • @rohitsahani8920
    @rohitsahani8920 4 ปีที่แล้ว

    Sir how to download codeblock

  • @rashmiranjannayak7352
    @rashmiranjannayak7352 5 ปีที่แล้ว

    Sir mera read nehi ho raha hai.....
    Msg aa raha hai file.exe has stopped working

  • @rajeshshukla3487
    @rajeshshukla3487 7 ปีที่แล้ว +1

    i have a doubt, in the video of the link th-cam.com/video/_KW_YBTXhN0/w-d-xo.html he is saying that fopen will give a address of first character of the file, and your are saying fopen will give the address of a structure type variable which is created along with file buffer

    • @mysirgdotcom
      @mysirgdotcom  7 ปีที่แล้ว +2

      I am right, no doubt about it. :)

    • @rajeshshukla3487
      @rajeshshukla3487 7 ปีที่แล้ว

      thanks for your quick reply. you helped me in a great extent for improving my knowledge in programming thank you very much. your teaching style is amazing.

  • @haziqjaved7220
    @haziqjaved7220 5 ปีที่แล้ว

    i can undetrstand it can u have a more easy way to understand

  • @mechtoit6555
    @mechtoit6555 4 ปีที่แล้ว

    sir, please tell me

  • @KNIGHT-yy7nh
    @KNIGHT-yy7nh 4 ปีที่แล้ว

    100 comment

  • @vinamra4893
    @vinamra4893 7 ปีที่แล้ว

    sir please aap ehe ACCHA kam kartey rahiyega karma jarur faal dega!!!

  • @KNIGHT-yy7nh
    @KNIGHT-yy7nh 4 ปีที่แล้ว +1

    your explanation way make you unique sir ☺

  • @pawandev1876
    @pawandev1876 3 ปีที่แล้ว

    ❤️❤️❤️