C_63 Strings in C-part 2 | Read a String using scanf and gets function

Поділитися
Вставка
  • Опубліковано 26 лип 2021
  • In this lecture we will discuss:
    - How to read a String using scanf and gets function?
    Best C Programming Tutorials: • Programming in C
    *********************************************
    Connect & Contact Me:
    Jenny's Lecture Hindi: / @jennyslectureshindi
    Facebook: / jennys-lectures-csit-n...
    Quora: www.quora.com/profile/Jayanti...
    Instagram: / jayantikhatrilamba
    Twitter: / khatrijenny
    Telegram Group Link: Jenny's Lectures
    telegram.me/jennyslectures
    *******************************************
    More Playlists:
    Programming in C Tutorials: • Programming in C
    C++ Tutorials for beginners: • Lec 1: How to Install ...
    Printing Pattern in C: • Printing Pattern Progr...
    Best Python Tutorials for Beginners: • Python - Basic to Advance
    Placement Series: • Placements Series
    Data Structures and Algorithms: https: • Data Structures and Al...
    Design and Analysis of Algorithms(DAA): • Design and Analysis of...
    Dynamic Programming: • Dynamic Programming
    Operating Systems tutorials: // • Operating Systems
    DBMS Tutorials: • DBMS (Database Managem...
    Tags:
    strings, string in c, what is string, c programming tutorials, c programming, best c programming tutorials
    #coding #strings #jennyslectures #cprogramming #clanguage

КОМЕНТАРІ • 477

  • @aparnamane4899
    @aparnamane4899 2 роки тому +123

    string is not a data type in c but it is array of character in c and format specifier for string is %s.

  • @giteshzemse2087
    @giteshzemse2087 Рік тому +31

    I'm very fortunate i found your UA-cam channel. You're a very scholar, talented woman. You tells so many good things to be a programmer. While you're a programmer, it's my dream to become one and your channel is a blessings for me.

  • @sarangbhasme4205
    @sarangbhasme4205 2 роки тому +11

    when you're teaching one good thing is your face is smiley it makes us happy. and felt like that nothing is impossible in life. Thank You So Much.

  • @nikitachaurasia11
    @nikitachaurasia11 3 роки тому +284

    Strings are not data type they are arrays of characters.

  • @JKA-sf7ll
    @JKA-sf7ll 2 роки тому +6

    constant string will be in code segment (compile time)
    modificable string will be in stack (runtime)

  • @techieadi4377
    @techieadi4377 3 роки тому +10

    The C language doe
    s not provide an inbuilt data type for strings but it has an access specifier “%s” which can be used to directly print and read strings. You can see in the above program that string can also be read using a single scanf statement.

    • @itz__ahana_
      @itz__ahana_ Рік тому

      Bro pls help......
      Why we are not writing scanf("%s",&name)????
      Instead of scanf("%s",name)
      But in other programs we use &name
      Why we are not writing address of ....

    • @prithwihegde349
      @prithwihegde349 Рік тому

      @@itz__ahana_ because string is a internal pointer which is pointing to base address of zerothindex of array

    • @Logan-ig7sm
      @Logan-ig7sm Рік тому

      ​@@prithwihegde349but bhai array mai jo array name hota hai bo bhi to internal pointer hota hai uske pass bhi base address hota hai usme to use krna pdta hai &operator why?

  • @siddhianand3646
    @siddhianand3646 Рік тому +21

    No, string is not consider as a data type in C but it represents as a character array in C.

  • @shuvamsahoo1130
    @shuvamsahoo1130 3 роки тому +3

    I was also teaching students on coaching ❤👍but your presentation is more student friendly mam

  • @vishalborate9608
    @vishalborate9608 Рік тому +2

    string is a character array, which is a known for a sequence of multiple characters ended by a special character null (\0) and its format specifier is %s

  • @Apshorts2123
    @Apshorts2123 2 роки тому +9

    string is not a datatype in c but it is considered as an array of characters.
    It is a specific type of array whose datatype is always char.

  • @delllaptop519
    @delllaptop519 2 роки тому +4

    11 : 40 That Smile Kill Me Alredy And Now I Am Waiting For Anthor Smile 😊

  • @ganeshghantasala2679
    @ganeshghantasala2679 Рік тому +1

    Your English is very clear to understand
    Thank you for your wonderful explanation

  • @sudhirchaudhary2936
    @sudhirchaudhary2936 2 роки тому +4

    Mam you don't have to be uncomfortable in telling that your channel is the best channel.ofcourse your channel is the best channel..lots of love from Nepali students mam🇳🇵

  • @inside6703
    @inside6703 2 роки тому +2

    Int main()
    {
    char name[20];
    printf("your name please") ;
    gets(name) ;
    Printf("hi :") ;
    puts(name) ;
    }

  • @talhashah3986
    @talhashah3986 2 роки тому +23

    String is not a data type in C
    But string is a data type in C++

  • @THETHIRDEYEjoji
    @THETHIRDEYEjoji Рік тому +1

    Hello Madam I have a question; In vscode how do I set the cursor to move down to the terminal each time I tap the enter button and I need to input some values especially when using scanf or gets. I find it cumbersome to have to move the cursor down manually all the time.

  • @z853c7
    @z853c7 Рік тому +1

    problem: both fgets and puts add a line-break after the input, so that you cannot output the %s in a continuous line of text. that only works with gets, but gets has the buffer problem.

  • @Aptitude_guide
    @Aptitude_guide 3 роки тому +24

    omaagodd ,Your smiling face 😊and great way of teaching ☺️🤩

    • @kmanish2528
      @kmanish2528 2 роки тому

      Really that smile in man's face is really 😍🥰

  • @erasamani2693
    @erasamani2693 5 місяців тому

    very good understanding seeing your videos more helpful

  • @Vijayee
    @Vijayee 3 роки тому +3

    String is not data type, String is constant of character and enclosed character in double quotes

  • @mq4950
    @mq4950 3 роки тому +1

    I have subscribed your channel and I used to come to see your daily vedios as your smile and beauty is superb and lovingly❤💖💖💖💖

  • @user-tq4ce7rq9u
    @user-tq4ce7rq9u 2 роки тому

    When you say right word on that time my heart was melting

  • @benspencer7491
    @benspencer7491 Рік тому +19

    11:39 best moment of lecture

  • @ParamitaDey-bi1mg
    @ParamitaDey-bi1mg 2 роки тому +1

    I am having one doubt.. miss you gave a solution of buffer overflow that we can write scanf("%4S",name) is this applicable for gets () function also ?? Pls anyone reply

  • @arsh2228
    @arsh2228 2 роки тому +1

    mam u are such an inspiring personality

  • @sachinghuge6194
    @sachinghuge6194 2 роки тому

    just want to say "you are the best "

  • @rohanpatil1834
    @rohanpatil1834 3 роки тому +1

    Dii thanku for your lectures and I really really adore you for that. Thanku Di.😄💯

  • @story-tamil
    @story-tamil Рік тому +2

    Very nice your explanation is 👌👌👌Thanks 😊

  • @36-muhammedshahinp64
    @36-muhammedshahinp64 11 місяців тому

    your class is perfect. also your smile keep it your smail

  • @funworld3530
    @funworld3530 2 роки тому +6

    No, string is not a specific datatype in c like int , float , char , but string can be defined as a character array in c.

    • @itz__ahana_
      @itz__ahana_ Рік тому

      Bro pls help......
      Why we are not writing scanf("%s",&name)????
      Instead of scanf("%s",name)
      But in other programs we use &name
      Why we are not writing address of ....

  • @obul231
    @obul231 2 роки тому

    Your voice 🌹,smile 🌹 &teaching 🌹
    I'm ur fan 💖

  • @thecoding_cat21
    @thecoding_cat21 Рік тому +1

    If you want to enter strings with spaces you can use "%[^
    ]" this format specifier instead of %s. It will allow you to enter strings with white spaces as input. Please inform me if I am wrong 🤔.

  • @rajurastogi6393
    @rajurastogi6393 Рік тому

    Best lecture no confusion ❤️❤️

  • @zubairbanaqib
    @zubairbanaqib 3 роки тому +1

    Thank you so much ma'am
    👍👍👍🙏🙏🙏

  • @hakimabahnu7722
    @hakimabahnu7722 Рік тому +1

    thank u soo much mam lots of love and respect from ladakh..😊🤗

  • @taneerumadhu2754
    @taneerumadhu2754 3 роки тому

    Mam I love your teaching

  • @Tejash_Gohel
    @Tejash_Gohel 3 роки тому

    aapke lecture me apnapan feel hota he

  • @mohdakramkhan4392
    @mohdakramkhan4392 2 роки тому +7

    String is not a data type in c.It is 1 D array of character.

  • @prabhagupta2929
    @prabhagupta2929 Рік тому +1

    Mam I was learning c from any other creator but I switched to your lectures as those lectures was not explained in detail,
    Btw loving your way of teaching.

  • @vivekgajara8418
    @vivekgajara8418 3 роки тому +3

    Mam there is no data type for string. There is just a format specifier %s to print string

  • @devSackey
    @devSackey Рік тому +1

    In c programming a string is not considered as a datatype but an array of characters (char)

  • @gio55964
    @gio55964 3 роки тому

    mam, i am from Bangladesh.you are best teacher in youtube.

  • @kanchupatihemanth8216
    @kanchupatihemanth8216 2 роки тому +3

    Hi mam thank you for telling these class and your class are most useful for diploma 1st year students in Telangana and small request mam try to explain in telugu.

  • @Shawaz11
    @Shawaz11 3 роки тому

    Good evening mam and mam you are best mentor and you are a actor 🤗 very quit quit moments. In everytime. 🤗

  • @meghasinha1706
    @meghasinha1706 2 роки тому

    Thanks for your efforts mam

  • @gowthamireddy8604
    @gowthamireddy8604 6 місяців тому

    U r super maam u r explaining like wow.....

  • @varaprasadb4430
    @varaprasadb4430 3 роки тому

    Excepting a heart from you mam
    Anyway thank you for your efforts

  • @RTBOSS
    @RTBOSS 3 роки тому

    Thank you...

  • @PramodKumar-qz9ex
    @PramodKumar-qz9ex Рік тому

    I fall love with c mam💕💕

  • @chandraharsha3446
    @chandraharsha3446 2 роки тому

    i was given a string size 5...and entered more than five characters at runtime by using scanf...but the output showing ,it was terminated????whats the reason?

  • @debojitacharjee
    @debojitacharjee 2 роки тому +4

    *FOR STRINGS WE SHOULD USE FOR LOOP TO AVOID THE BUFFER OVERFLOW* - initializing the array directly using scanf or gets is not a standard rule and are not for using with strings but only with characters using for loops

  • @Nikhilrao354
    @Nikhilrao354 3 роки тому +2

    I am completed my 12 , when I search theorem of class 9 of my brother so I am find your vedio , and I am addicted your vedio 🤭

  • @chohan2253
    @chohan2253 Рік тому

    If I initialize a string of size 10 and try to find the 25th character in this string it is not showing any error why?

  • @mahendrab.k7278
    @mahendrab.k7278 11 місяців тому +1

    Mam your smile literally made me fall in love with you ❤❤❤.
    Love and support from Nepal 🇳🇵🇳🇵🇳🇵🇳🇵🇳🇵🇳🇵🇳🇵🇳🇵🇳🇵

  • @gayatriborade9556
    @gayatriborade9556 2 роки тому +5

    string is not a datatype in c but it is a character array which ends with \0

  • @jaga4123
    @jaga4123 Рік тому

    Mam you are the best programming teacher mam , love you mam❤❤❤

  • @NU_SudeepaPatnaikpakki
    @NU_SudeepaPatnaikpakki 2 роки тому +3

    Mam...we can print entire string along with space using scanf......please use this format...
    Scanf("%[^
    ]s",str);
    This statement reads the input until newline occurs....

  • @akhilmittal3283
    @akhilmittal3283 2 роки тому +2

    you are superb mam

  • @laxmikantbotkewar4191
    @laxmikantbotkewar4191 2 роки тому

    we can use scanf( "%[^
    ]s" , name) it will fetch till new line character.

  • @a_yucodes9625
    @a_yucodes9625 3 роки тому

    Mam please make a separate video on scanf ,gets,fgets !

  • @expecttheunexpected6717
    @expecttheunexpected6717 2 роки тому +1

    But mam I'm using gets(name) but it's not taking my full name with space (vadthiya Santhosh naik) . It's output is just Vadthiya Santhosh... How can i solve this..?

  • @shubhampatidar1814
    @shubhampatidar1814 2 роки тому

    Thank you

  • @thenarrator5031
    @thenarrator5031 3 роки тому

    Iam your new subscriber ma'am... :)

  • @yadavsnair
    @yadavsnair 3 роки тому +1

    500k loading 😍😍

  • @saisyamuppalapu9174
    @saisyamuppalapu9174 3 роки тому +1

    Mam, Why don't you finish OS lectures?
    Please take a look on it.

  • @vineetahuja1375
    @vineetahuja1375 3 роки тому +1

    Mam please upload the lecture of c++ and java also

  • @gamingwithteddy7019
    @gamingwithteddy7019 Рік тому

    I fall love with c language 🥰😂❤

  • @keerthanas5634
    @keerthanas5634 Рік тому +1

    No string is not a datatype it is used in header files #include

  • @A.KSTUDIO755
    @A.KSTUDIO755 9 місяців тому +1

    No strings are not data types. It is array which is terminated by null character

  • @daughter_of_chitkute0611
    @daughter_of_chitkute0611 7 місяців тому +1

    No there is not such datatype called string in C so we use array of characters to represent it as a string.

  • @nomuladivya3160
    @nomuladivya3160 2 роки тому +1

    Stings are not datatypes they are array of characters and we explicitly declare it as char

  • @babunaik371
    @babunaik371 Рік тому +2

    Good evening mam, strings are not a data type in c.

  • @rohitmodi9169
    @rohitmodi9169 Рік тому +1

    It is not a data type ,it will only take the character values

  • @N3Dceation
    @N3Dceation 2 роки тому

    Smile is Ultra pro max

  • @vigneshk9598
    @vigneshk9598 2 роки тому

    madam your teaching is good

  • @mohitsodha2346
    @mohitsodha2346 Рік тому

    Tq mam

  • @parica117
    @parica117 2 роки тому

    Thank you mam

  • @tulas11
    @tulas11 Рік тому

    It says segmentation fault when I try to buffer overflow!

  • @matamsidhartha3714
    @matamsidhartha3714 Рік тому

    mam in online GDB compiler gets function is giving error.. I'm unable to use gets but in other compiler it is working

  • @AsifRaza-tc8kt
    @AsifRaza-tc8kt 2 роки тому +2

    string is not a datatype in C. It is the character array in C

  • @leelataddi9940
    @leelataddi9940 2 роки тому

    String is one of the derived data type

  • @programmer1682
    @programmer1682 Рік тому +2

    String is not a data type it is character type.

  • @srmaptrekkers
    @srmaptrekkers 2 роки тому

    String is not a data type, it represents character array

  • @user-nf6qd8ip9v
    @user-nf6qd8ip9v 7 місяців тому +1

    No,string is not a datatype. But it is a character set of array

  • @vsunilkumar5289
    @vsunilkumar5289 3 роки тому

    Madam it'll helpful if you teach finite automata theory and machine learning

  • @srikaryenugula
    @srikaryenugula Рік тому +1

    Srikar diploma in ec is also watching your videos!

  • @alapankonar
    @alapankonar 2 роки тому

    Mam how to overcome the problem of buffer overflow??

  • @shivendra3019
    @shivendra3019 3 роки тому +2

    String is an array of characters in C but it is not an explicit datatype unlike in Java and other programming languages etc.

    • @nileshbhaskar9010
      @nileshbhaskar9010 2 роки тому

      String is a class in java, not primitive data type

    • @shivendra3019
      @shivendra3019 2 роки тому +1

      @@nileshbhaskar9010 It is a Class Type and not Wrapper as it does not have a parallel primitive type.

    • @nileshbhaskar9010
      @nileshbhaskar9010 2 роки тому

      @@shivendra3019 no it's not

  • @anesp.a913
    @anesp.a913 2 роки тому +1

    I hope you are my teacher in 2003 boring classes of Engg college...

  • @sunnyyt3995
    @sunnyyt3995 2 роки тому +1

    Strings are arrays of characters but not data types

  • @shahzaib715
    @shahzaib715 3 роки тому

    kindly make C++ lectures series thanks

  • @debdiptadas7812
    @debdiptadas7812 2 роки тому

    is there no need of & operator in scanf??

  • @protech9778
    @protech9778 3 роки тому

    String is not a datatype it is a constant of character

  • @VinjamRajesh-vu9px
    @VinjamRajesh-vu9px 6 місяців тому +1

    string is not a data type in c but we can represent it with "char" data type is "%s".

  • @kallugaming1k
    @kallugaming1k Рік тому

    Mam ap ki muskurahat bhut payari h
    ❤❤❤❤

  • @user-lo5is4cv2l
    @user-lo5is4cv2l 7 місяців тому +1

    No strings are not data types because "string":array of characters 😊😊

  • @annapureddynagiredddy1648
    @annapureddynagiredddy1648 Рік тому

    madam what happen when we include null charctor as a part of string

  • @yashhokte1020
    @yashhokte1020 2 роки тому +2

    String is not a data type we can considered string as the character arrays or it is an array of characters which is ended with the null character ('\0')..
    But the format specifier which is used to print the whole string is %s

  • @sunnyjaiswal7746
    @sunnyjaiswal7746 2 роки тому +1

    NO, string is not a seprate datatype in C but it used as character datatype in C

  • @devanshshrimali2125
    @devanshshrimali2125 2 роки тому +2

    No stings is a not a data type in C. It is a array of characters.