Lecture 27 Reading from a file in C Language Hindi

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024
  • Like, Comments, Share and SUBSCRIBE

Комментарии • 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😊

  • @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 3 года назад +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

  • @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

  • @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

  • @vakhariyajay2224
    @vakhariyajay2224 2 года назад +1

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

  • @HeiStMP
    @HeiStMP 4 года назад +1

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

  • @SalimShaikh-qp7zl
    @SalimShaikh-qp7zl 4 года назад

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

  • @psychology1649
    @psychology1649 4 года назад +1

    Great work sirr genuine teacher

  • @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.

  • @rahulsoni353
    @rahulsoni353 4 года назад

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

  • @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.

  • @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 3 года назад +1

      Bhai meri file open nhi ho rhi hai

  • @muradali7360
    @muradali7360 8 месяцев назад +1

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

  • @anshumanpurohit4278
    @anshumanpurohit4278 Год назад

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

  • @shubham-pm8qx
    @shubham-pm8qx 5 лет назад +2

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

  • @swayamprakashsahoo9002
    @swayamprakashsahoo9002 4 года назад +1

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

  • @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

  • @shudhanshugupta439
    @shudhanshugupta439 5 лет назад

    Sir u r the best , really

  • @100rabhish
    @100rabhish 6 лет назад +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 ?

  • @ankurkumar-bn4xd
    @ankurkumar-bn4xd 5 лет назад

    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.

  • @karanvedi6779
    @karanvedi6779 2 года назад

    Thankyou very much sir,,,, 🙏👍

  • @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

  • @extremetech5854
    @extremetech5854 5 лет назад +1

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

  • @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?

  • @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?

  • @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 5 лет назад

      Bro it gives extra space on output screen

  • @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 4 года назад

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

    • @Goku-tt5hb
      @Goku-tt5hb 3 года назад

      @@sankalpsachan9199 true

  • @amolacharya5342
    @amolacharya5342 7 лет назад

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

  • @ranashaka5585
    @ranashaka5585 4 года назад

    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....

  • @asthagoel6177
    @asthagoel6177 5 лет назад +2

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

  • @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

  • @karanmaurya2216
    @karanmaurya2216 Год назад

    Thankyou sir ji 🙏

  • @happyhemantsingh8583
    @happyhemantsingh8583 3 года назад +1

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

  • @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 .

  • @rajnish1002
    @rajnish1002 3 года назад

    👏 👌 👍🏻

  • @nitingupta8029
    @nitingupta8029 5 лет назад +1

    👍👍👍👍👍👍

  • @thetrender6798
    @thetrender6798 4 года назад

    Majja aa gaya

  • @techsapmadeeasy
    @techsapmadeeasy 5 лет назад

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

  • @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 3 года назад +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 3 года назад

      @@Goku-tt5hb thanks bro

  • @rajnikantpyarelal6162
    @rajnikantpyarelal6162 5 лет назад

    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...............

  • @julisharma9562
    @julisharma9562 4 года назад +1

    Very nice sir

  • @girijendratripathi6850
    @girijendratripathi6850 3 года назад

    thanku so much sir

  • @Youandme1717
    @Youandme1717 Год назад

    Awesome

  • @ansonalexander009
    @ansonalexander009 7 лет назад

    file is defined in stdio or stdlib?

  • @sachinsharma-dx6ms
    @sachinsharma-dx6ms 7 лет назад

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

  • @SahilSingh-js9oe
    @SahilSingh-js9oe 6 лет назад

    Thanks sir for dis video

  • @asthagoel6177
    @asthagoel6177 5 лет назад +1

    What is the need of fclose() here?

  • @bhindekaur2211
    @bhindekaur2211 4 года назад

    thankyoy sir🙏

  • @aakansha5029
    @aakansha5029 7 лет назад

    How to read both text and integer from file ?

  • @mechtoit6555
    @mechtoit6555 4 года назад

    sir why code block is important

  • @pawandev1876
    @pawandev1876 3 года назад

    ❤️❤️❤️

  • @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

  • @sohilmansuri3579
    @sohilmansuri3579 7 лет назад +5

    exit(1) kya he sir ?

    • @amansharma-ww7tv
      @amansharma-ww7tv 6 лет назад

      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

  • @healthadvicebysatyamdubey4571
    @healthadvicebysatyamdubey4571 4 года назад

    Sir aap allahabad kabhi ghumne aye hai

  • @shubhamkumarshaurya9326
    @shubhamkumarshaurya9326 3 года назад

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

  • @GunnuGilahari92
    @GunnuGilahari92 7 лет назад

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

  • @shubhpandey5228
    @shubhpandey5228 7 лет назад

    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

  • @brahmanandakabi8796
    @brahmanandakabi8796 3 года назад

    Sir if you create through program it will not work

  • @commas7430
    @commas7430 6 лет назад

    fgets() return int value

  • @thefuntech2810
    @thefuntech2810 6 лет назад +4

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

    • @NikhilSingh-yo1ul
      @NikhilSingh-yo1ul 5 лет назад +3

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

  • @khansirgkquiz8715
    @khansirgkquiz8715 6 лет назад

    Thank u sir

  • @b.kkanhaiya6181
    @b.kkanhaiya6181 4 года назад

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

  • @besttimeofthisplanet4234
    @besttimeofthisplanet4234 6 лет назад

    thsnks..

  • @mitulmakwana1535
    @mitulmakwana1535 4 года назад

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

  • @shubhamkumarshaurya9326
    @shubhamkumarshaurya9326 3 года назад

    where is the playlist of this video

  • @believeinpractical3930
    @believeinpractical3930 4 года назад

    Nice

  • @dharmender1975
    @dharmender1975 6 лет назад

    if we cannot use fclose() than what will happen

    • @techsapmadeeasy
      @techsapmadeeasy 5 лет назад

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

  • @shashankvashishtha4454
    @shashankvashishtha4454 4 года назад +4

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

  • @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

  • @rashmiranjannayak7352
    @rashmiranjannayak7352 5 лет назад

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

  • @lonewolfmohit
    @lonewolfmohit 3 года назад

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

  • @rajeshshukla3487
    @rajeshshukla3487 7 лет назад +1

    i have a doubt, in the video of the link ruclips.net/video/_KW_YBTXhN0/видео.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.

  • @ashishsinha8893
    @ashishsinha8893 8 лет назад

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

  • @yugalkishore8991
    @yugalkishore8991 5 лет назад

    sir what is the location of file
    f1.txt

  • @rohitsahani8920
    @rohitsahani8920 4 года назад

    Sir how to download codeblock

  • @haziqjaved7220
    @haziqjaved7220 5 лет назад

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

  • @rabinkumardadel6224
    @rabinkumardadel6224 3 года назад

    Explation❤️❤️❤️🐒

  • @KNIGHT-yy7nh
    @KNIGHT-yy7nh 4 года назад

    100 comment

  • @vinamra4893
    @vinamra4893 7 лет назад

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

  • @mechtoit6555
    @mechtoit6555 4 года назад

    sir, please tell me

  • @KNIGHT-yy7nh
    @KNIGHT-yy7nh 3 года назад +1

    your explanation way make you unique sir ☺

  • @amaansiddiqui734
    @amaansiddiqui734 4 года назад

    ❤️❤️❤️