User Input for Char Arrays or strings in C program with spaces

preview_player
Показать описание
Scanf space issue. How to take user input for char array or string with spaces in sentences/input in C programming language.
Рекомендации по теме
Комментарии
Автор

Thanks a lot! you solved my doubt in minutes. This is what I was looking for! :) ~from an Indian student.

techtronics
Автор

2 minutes into your video saved me from lossing 50 liked, subscribed and commented.... Your a real saviour ...

Alchemist_Sanctuary
Автор

Just wow! Your explanation was understandable for me as a beginner programmer.

tuhinmahmud
Автор

Thanks a lot. This was really helpful for me, especially the fact that the gets() is not recommended for use cause I wasn't told that in class.

sandisosenzo
Автор

Thank you so much for providing us such lots of ways to do it!

yingqichen
Автор

That scanf method is quite interesting

doafliphoe
Автор

You earned a subscriber! thanks a lot!

samnayakawadi
Автор

You helped me a lot ✌🏻✌🏻✌🏻 You are awsome ❤️❤️❤️...I want to see you a reputated youtuber in future...keep it up ❤️❤️❤️...loves from INDIA ✌🏻

soumyadipmajumder
Автор

gets doesn't work for capturing user input into 2-D string arrays. Pls help.

yuukitaiyou
Автор

Hello. I am trying to use your fgets method for one of my project, but i am having trouble with it because i am using a char array. Let say:

char name[3];
for(int i=0; i<3; i++)
{
//Scan in the user input for adress 0 and then 1 and then 2;
printf("%s", name[i]);
}
How would you use fgets in this situtation or should i just stick to your final method?

SpottedPredator
Автор

There is a question ❓
Q: Can I use 'fgets' use more than one?

soumyadipmajumder