Lecture 13 Strings in C Part 1 Hindi

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

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

  • @sajalagarwal8627
    @sajalagarwal8627 7 ปีที่แล้ว +252

    sir.....i m prepairing for gate ................or agar aap ho tabhi me gate ki prepration kar pa raha hoon ....sir aapne jo knowledge free di hai aisa koi ni karta .....sir apne financialy weak bacho ka boht bhala kiya hai .. god bless you

    • @anikkarmakar3
      @anikkarmakar3 6 ปีที่แล้ว +15

      i agree with u.

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

      Use #include

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

      @@shristisingh2417 us se kya hoga ?

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

      😀😀😀

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

      so, how was your gate results?

  • @dharmanshah1239
    @dharmanshah1239 5 ปีที่แล้ว +129

    Summary of the lecture:
    String is a sequence of characters terminated at null character.
    Null character is a special character whose ASCII value is 0.
    While assigning letters to a character array,we explicitly write null character just to use it in looping condition,though it is not compulsory ,ex-
    char a[10]={'a','b','c','\0'};
    While assigning a string to a character array,no need to explicitly write null character,ex;-
    char a[10]="ABC";
    For printing the characters,
    for(i=0;s[i]!='\0';i++)
    printf("%c",s[i]);
    NOTE:%c is a format specifier used to print only a single character(that is why we use a loop)
    For printing a string
    printf("%s",s);//s=base address
    NOTE:%s is format specifier used to print only whole string(it takes base address of the array than access whole array to print the array)
    VERY IMP:
    Writing the name of the array represents first byte memory address of that array.
    ex-
    char s[10];
    scanf("%s",s);//s= address of first byte of array(also known as base address)
    Alternate function for printf:
    puts(stringname)
    puts is used to - print a string only and to send program control to new line after printing the string
    Limitations of scanf:
    takes space,enter or tab as delimeter
    Alternate function for scanf:
    gets(stringname)
    takes only enter as a delimiter
    Thank you !!

    • @GauravKumar-xn7km
      @GauravKumar-xn7km 4 ปีที่แล้ว +4

      Thanks🙏🙇

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

      Hats Off👍

    • @7akon
      @7akon 4 ปีที่แล้ว

      We do not need to explicitly assign '\0' when defining a string letter-by-letter.

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

      Dude you are awesome 👏

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

      Awesome👏✊👍

  • @Mustafa-099
    @Mustafa-099 5 ปีที่แล้ว +36

    You are truly an underrated youtuber
    "Hire ki pehchan to johri ko hi hoti hai "

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

    Sir after watching your video of pointers i have tried many other videos to get some more stuff. But after watching their videos i feel that NO ONE IS BETTER THAN YOU IN TEACHING C PROGRAMMING. SALUTE YOU SIR.

  • @jinks6887
    @jinks6887 6 ปีที่แล้ว +13

    Bhagvan aapka bhala kare sir. Thanks for all your efforts.

  • @harshithasunkara7621
    @harshithasunkara7621 6 ปีที่แล้ว +10

    U r dng a good job sir ,these helped me a lot , thank u so much

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

    Your videos are so understandable, thank you so much !!!

  • @australianewzeland682
    @australianewzeland682 7 ปีที่แล้ว +25

    KHATARNAK VIDEO SIR , ZHAKKAS

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

      Video zaher hai bhai sahab ek baar mein samaj mein aa gaya

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

      Thik se samjhe SB tb samjh me aayega

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

    Sir, you are doing very good job.Helping those children who all can't afford to take tutions and even to those who all have quit on programming. God bless you sir and i'm saying all with my heart.
    May yo get,achieve whatever you want to :)

  • @AmitKumarSaini-kf4cn
    @AmitKumarSaini-kf4cn 6 ปีที่แล้ว +10

    sir aapke padhane se maine c language sheek li.thanks sir

  • @iqramaryam8764
    @iqramaryam8764 8 ปีที่แล้ว +21

    sir i like ur every lecture ur teaching is outstanding to understand any language easily

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

    Sir you are doing a great job
    Thank you 😊

  • @Jennifer-tq8ut
    @Jennifer-tq8ut 5 ปีที่แล้ว +5

    Thanks a million sir..ur videos are so helpful

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

    sir aap ka ye ehshan kabhi nahi bholl payenge
    god bless you sir ......may u live long

  • @PreetiSharma-fu2ni
    @PreetiSharma-fu2ni 4 ปีที่แล้ว +1

    Sir bahut accha smjaya apne. .
    Gr8. .👌

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

    And give us questions related to topics discussion to solve.

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

    Sir that’s relly good that u tech us free and much better than any one

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

    I never post a single comment on ur videos sir ,just because i dont have words to appreciate ur stuffs and such great explanation of all these concepts,rit now i m going through ur videos of 3 courses i.e c,c++,&data structure ,and i m going well just bcz of ur excellent and depth explanation of all topics......thanku very much sirrr....

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

    Thank you so much sir for providing us such wonderful free knowledge of C language.Your way of teaching is amazing and systematically even a dull student can easily understand again thanku so much sir because of u sir now I am fully confident that I can give answer to any questions regarding C ❤️❤️❤️❤️❤️❤️

  • @AbhishekSharma-ep9km
    @AbhishekSharma-ep9km 6 ปีที่แล้ว +4

    Very well explained sir....thanx a lot...to help us 🙏🙏🙏

  • @gambheerrawat9667
    @gambheerrawat9667 8 ปีที่แล้ว +2

    saurabh sir, you are too good.. thank you very much for updating.............

  • @balochalee1466
    @balochalee1466 6 ปีที่แล้ว +3

    we love you saurabh sir

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

    Thanku very much sir ,I m in Iit but i don't find lectures and teaching methodolgy like u ...ur lectures are best .God bless u,dear sir

  • @sufiminhajian4255
    @sufiminhajian4255 6 ปีที่แล้ว +3

    great sir I request you sir make more videos on string that includes user defined functions

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

    Sir bhut acche se smjate ho ...concept clear ho jata hai

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

    Sir 🙏🏻 you are great... Please asa hi padhaoo.. Video 🔥 🔥 🔥 🔥

  • @rajvirkasyap9085
    @rajvirkasyap9085 8 ปีที่แล้ว +9

    sir, if we assign a character variable with some low value,even then gets()takes accepts value>=char[i] and puts() also print it all ,then why we assign char[ ] value before

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

      To provide the compiler the base address of the string. Dono hi tarike se kar sakte hai....

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

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

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

    this video is the one of the best video for me ... Thankyou sir

  • @vinaypathak1171
    @vinaypathak1171 7 ปีที่แล้ว +6

    nicely explained sir. Sir if s in printf("%s",s) represents the base address of string ,then it should print only the base address character ,how does it prints the full string.

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

      Vinay Pathak kuki y array bhi h ... or array k andr starting ka address mil jata h toh wo continue last tk print kra deta h .. string m bhi esa hi hua h isme starting ka address yani l &s[0] mil jata h or baki k liner tarike s print kr deta h

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

      bhai yahe difference hai array me aisa nhe hota bt string me hota hai isliya specifier s hai btagar specifier c kroge to na hoga

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

    I always follow your every video.....And I would like to so much thank for you......Thank you...Thank you so much sir.........

  • @bhivraj3802
    @bhivraj3802 8 ปีที่แล้ว +2

    thanks for making to strongs concepts.
    it i best ref. to learn C.

  • @prakharsrivastava6857
    @prakharsrivastava6857 6 ปีที่แล้ว +5

    Could we use for loop like scanf("%c",s) with i as counter variable while taking input from user???

  • @anilkushwahaji5788
    @anilkushwahaji5788 9 ปีที่แล้ว +5

    sir awesome lecture i really like it please sir please upload more tutorial on union and enumulater

  • @RajatGupta-rj5ig
    @RajatGupta-rj5ig 3 ปีที่แล้ว

    nicely explained sir!!! but.....
    14:04 sir aapne printf m '&' kaise use kiya ye toh sirf hum scanf m use karte hai...???

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

    sir...there is a warning of suspicious pointer conversion when using puts(s); what does it mean?

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

    Sir thankuu so much for this wonderful video, before this video I was not able to understand string from anywhere. But after this my all doubts related to string can easily solved

  • @mayanksingh-fq6nb
    @mayanksingh-fq6nb 6 ปีที่แล้ว +2

    in light way to understand the concept of string concept my request is see all the video note the every point which sir tell its seems to be the video is 17 min but the sir tells lots of concept so please see the video very carefully .....thank you sir

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

    Sir ek doubt hai. (7:30) Jab aapne printf("%s",s); use kiya to pura string print hua to string me to null character bhi tha to uski vajah se ek space banna chahiye tha na SAURABH k baad jaise pehle loop use karke bana tha? Please correct me if I am getting it wrong.

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

    Sir ji love you because of you teaching

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

    Sir truly it's great , understandable and lovely videos

  • @LAVDEEPCHAHALBME
    @LAVDEEPCHAHALBME 9 ปีที่แล้ว +2

    dividing videos is a nice concept

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

    Sir if I put space first and then enter any name will it give us a output

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

    doubt--sir jab aapne scanf("%s",&s[0]); likha toh kya compiler automatically samaj jayega ki first character ko &s[0] me daalna he then second character ko &s[1] me daalna he ...............and similarly last ith character ko &s[i] me daalna he

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

    Sir control string ke kya uddesy hai aur yh kase bnti hai aur kis prkar ki suchna prdan krti hai

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

    Sir... In programs why use int i,? If there is no looping there is no need to use this bcz we are not using this in program with int i, program can run nd it is giving the same output ..... Plz sir give me ans.....

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

    Very nice sir 😍😍

  • @AdityaKumar-tv7sb
    @AdityaKumar-tv7sb 6 ปีที่แล้ว

    Sir jaise hm use krte hai &s(0) puts me to isme to uska address print hona chahiye jaise aapne liya hai 1000 to ye put hona chahiye us address ki value print kraane k liye to hm * ka use krte hai

  • @luvkush2407
    @luvkush2407 2 ปีที่แล้ว

    very nice explanation sir!!...hats off to you

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

    Dear Sir, thank u so much for your tutorials. But I have a question, how for() loop check the null character when it receives data from user. pls solve my query.

  • @i.m.crazyvele4101
    @i.m.crazyvele4101 6 ปีที่แล้ว +2

    सर आपको कोटि-कोटि धन्यवाद्

  • @vanshkumar3445
    @vanshkumar3445 2 ปีที่แล้ว

    Sir apki video se mujhe c programming samajh a gyi

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

    your video is best for logical learning

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

    Sir scanf me aapne S[0] use kiya he jisse first address mil jaye but int array me aisa kyu nahi kiya tha?

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

    Thank you so much sir 🙏

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

    First of all thank you very much sir for given these largest knowledge
    Sir in this program you run whitout header file how it is possible
    Plz explain me

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

      sir g ka jaadu

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

      Source file ka extension .C hai

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

    sir aap bole ki printf("%s",&s[0])aur ("%s",s) likhna sam hai bt
    first se to address print hona chaheya aur second se string ..???

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

      Us address pe jo string hai wo print hoga, naki uska address

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

      %d likha hota to address print hota shayad

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

    Sir in later example of gets and puts where we are not using for loop do we have to initialize i

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

    Outstanding teaching style

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

    sir mai turbo me programmin karta ho to error dikhata hai aur code blocks me nahi to mai ky akaru

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

    Sir kya gets() puts() ka bhi headerfile stdio.h hai?

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

    sir how can we make a condition of factorial using recursions and pointers

  • @ms.abhasaxena7249
    @ms.abhasaxena7249 4 ปีที่แล้ว

    if string size which we have defined is less then the size of string which user has entered ,then what is exactly happening inside? Is it increasing the size of string automatically
    for example i defined
    char a[5];
    and user enters a name abha saxena ,its size is more than 5 but still it is printing full name .

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

    sir aapne saurbh shukla print karwaya toh jo space de array uske liye bhi memory occupy karega ya nhi

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

    sir its gud but at 14:01 i didnt understand the concept like for adress s(0) its printing the content present in it and for normal s also its printing the value present in it ,are they one and the same? if so how can adress and the value in it are same

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

    Sir aap direct "main ( ) " function ka use kase karte he. Or program run ho jata he.please

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

      sir g ka magic

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

    Sir ismein aap scanf mein &s[0] kaise likh sakte hain kyunki puri string ke alag alag characters to s[0] s[1] s[2] s[3] aise alag alag address mein jayenge.

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

    Sir should we always declare the size of string , length of string plus null character or we don't have to take extra cell for null character, and what if we don't take space for null character will it be created automatically sir please clear the doubt.

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

    sir jab ham user se character input kara rahe han tab bhi kya compiler automatic hi null character ko jod deta h??

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

    thank u sir i learnt a whole programming from your lectures\\\\\\.........

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

    sir ....in this video, what is meaning of char s[20] in last the programe ?
    because it takes whole string whish has greater then 20 charactor or variable of string array.

  • @vanshkumar3445
    @vanshkumar3445 2 ปีที่แล้ว

    Sir apki video se string in c language samajh a gya

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

    Thankyou sir. Aapke lectures outstanding h..

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

    #respect @sir ji you are evergreen awesome

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

    scanf() sa kaya multiple word input nahi la sakta??
    kasavi??

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

    sir jb hm length nikal rhe hh kisi b do strings ki toh ye(gets) unke beech k space ko q count krra hh?
    ex- mayank Raj
    output- 10

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

    Sir 14:00 per printf me address kyu kiya
    &s[0] likha hai

    • @Sandeepverma-uj5le
      @Sandeepverma-uj5le 4 ปีที่แล้ว

      Because s[0] and &s[0] are equivalent both represent the address.

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

    For initialization after name saurabh putting \0 is compulsory ?

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

    Thnxz

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

    sir for loop ke bad curly braces ka use kab krenge or kab nhi?

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

    Sir .. Jaise hm .. Int ke liye %d use krte h .. %f nhi kr sakte ..to .char me %s ... Kaise use kr sakte h ..

  • @priyanshumahur2656
    @priyanshumahur2656 2 ปีที่แล้ว

    Sir in char type value we use %c ,in float use %F but sir in int case why do we use %d.

  • @HimanshuGupta-rh6vg
    @HimanshuGupta-rh6vg 7 ปีที่แล้ว

    sir kya hm ek string ko dusri string m direct assing kra skte h jb dono string ki leanth same h

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

    Thanku Sir ji

  • @amanprajapati6301
    @amanprajapati6301 2 ปีที่แล้ว

    Happy teachers day sir ❤️

  • @r.i.pnandy2854
    @r.i.pnandy2854 4 ปีที่แล้ว

    Very helpful video, sir😍

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

    So good 👍 👍 👍 👍 👍

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

    Tq sir u r vidios are very understandable.

  • @Alok.28
    @Alok.28 3 ปีที่แล้ว

    Sir, without header file include kiye program kaise run ho rha hai? Hamara to error aa jata hai.

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

    Sir, thanks for your help to learn the basics of string.....
    Sir, can you please give us some examples of programs to understand it better .

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

    hello sir
    for variables if we write &variable in printf it prints its address but why not in arrays or strings as here its printing the value of string??

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

    what happens if user input greater than size of string in c..plz reply sir

  • @AnkitMishra-mz4xt
    @AnkitMishra-mz4xt 4 ปีที่แล้ว

    Sir String or Character array me kya difference hota hai?

  • @user-gi8lt3tc8n
    @user-gi8lt3tc8n 4 ปีที่แล้ว

    Sir what is the main reason of using libraries of different names

  • @W-UProductions
    @W-UProductions 6 ปีที่แล้ว

    sir your video is helpful.love from Pakistan

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

    Sir i always gets confused in string , can u tell me the problem in my code is ? :/ ,
    //write a program which takes input of 5 countries and print them in alphabatic order ..
    #include
    #include
    main(){
    char c[100];
    int i,j;
    char tmp;
    //taking input for 5 countries ..
    for(i=0;i

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

    sir, gets() is not working , what to do? I am using gcc compiler and running my code on linux terminal.
    The error is shown as "implicit declaration of gets() function ....gets function is dengerous and should not be used".

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

    Sir mai kisi ek structure ke variable se us structure ke ek kisi structure variable jo ki charater array type ka hai, toh mai usko kaise input le sakta hu main function mei? gets karne se nahi aa raha hai input. blank input aur blank output aa raha hai.

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

    Sir i have 1 question..if scanf cant print any char value after tab then we have to always use gets instead of scanf whenever we need to write after tab..kindly clear my doubt sir, I will be extremely thankful to u for this.

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

    Sir i have a question. Sir mera question ha ke agr zero pehla variable ka element represent karta ha to printf("%s", s[0]) se baki ke varibles me moujood elements bhi kyo print ho jate hain.

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

      Kyuki variable lagatar m memory consume karke hn