C user input ⌨️

  Рет қаралды 44,953

Bro Code

Bro Code

Күн бұрын

C how to accept user input scanf fgets tutorial example explained
#C #user #input
char name[25]; //bytes
int age;
printf("
What's your name?");
//scanf("%s", &name);
fgets(name, 25, stdin);
name[strlen(name)-1] = '\0';
printf("How old are you?");
scanf("%d", &age);
printf("
Hello %s, how are you?", name);
printf("
You are %d years old", age);

Пікірлер: 48
@BroCodez
@BroCodez 2 жыл бұрын
#include #include int main(){ char name[25]; //bytes int age; printf(" What's your name?"); //scanf("%s", &name); fgets(name, 25, stdin); name[strlen(name)-1] = '\0'; printf("How old are you?"); scanf("%d", &age); printf(" Hello %s, how are you?", name); printf(" You are %d years old", age); return 0; }
@thegamingpaul3743
@thegamingpaul3743 2 жыл бұрын
how about the birthdate?
@TodiDiang
@TodiDiang Жыл бұрын
How about this #include int main() { char input1[100]; char input2[100]; printf("Input 2 (without space): "); scanf("%s", input2); printf("Input 2: %s ", input2); // Clearing input buffer while (getchar() != ' '); printf("Input 1 (with space): "); scanf("%[^ ]", input1); printf("Input 1: %s ", input1); return 0; } My friend using that code
@annoyingprecision2487
@annoyingprecision2487 Жыл бұрын
This was a splendid lesson on user input in C. Thanks a ton.
@TheScissorunner
@TheScissorunner Жыл бұрын
Great production quality with your videos!
@eeneemeenee6236
@eeneemeenee6236 9 ай бұрын
i like that u mention the gap in knowledge at certain parts
@shiwari1280
@shiwari1280 2 жыл бұрын
Thanks for the tutorials bro!
@pakapeta7772
@pakapeta7772 2 жыл бұрын
Very useful, cheers mate.
@fabiovictorino350
@fabiovictorino350 2 жыл бұрын
Very simple and good.
@t-ree
@t-ree 2 жыл бұрын
Thank You!!
@azeedhazard7638
@azeedhazard7638 Жыл бұрын
amazing bro👍
@ghazihattab
@ghazihattab 2 жыл бұрын
ur the best :)
@Grab-Deals
@Grab-Deals 3 ай бұрын
Great
@user-mc9uv7ij7x
@user-mc9uv7ij7x Жыл бұрын
❤❤❤❤
@not_pockchan3418
@not_pockchan3418 2 жыл бұрын
noice, the string format also doesn't seem to advanced, great teaching bro
@ShStepan
@ShStepan 2 жыл бұрын
fgets(); Which autocomplete do you use for that?
@cadmium4113
@cadmium4113 2 жыл бұрын
Bro❤️
@MerryMerry632
@MerryMerry632 8 ай бұрын
@sashaktyadav7998
@sashaktyadav7998 2 жыл бұрын
I asked you a question that Which language is best for making mobile app than can control robots (Both iphone and android) ? Pls reply sir 🙏
@BroCodez
@BroCodez 2 жыл бұрын
Python with Kivy framework could work
@user-ace96plays
@user-ace96plays Ай бұрын
DONE❤
@nem0103
@nem0103 2 жыл бұрын
when i press run it direct to output and not terminal. how to run it??
@harshitpandit188
@harshitpandit188 2 жыл бұрын
Hi bro. I've been watching Java tutorial from your series only.Please help me with the setup of Java in Visual Studio Code Also are you planning any series on android development ??
@Onestonedbake
@Onestonedbake 8 ай бұрын
wazzup bro code!!! im new to the community!!!
@thiemhoang3015
@thiemhoang3015 2 жыл бұрын
how can run in the black console like visual studio ??
@redemedy8602
@redemedy8602 2 жыл бұрын
cmd in windows
@pamlongwood4217
@pamlongwood4217 9 ай бұрын
legend
@iasmin-i
@iasmin-i 9 күн бұрын
How do you do, fellow kids!
@HyProDuxyMusicHandle
@HyProDuxyMusicHandle 11 ай бұрын
am not 21 anymore but i pretend i still am!
@rezuwankabir3372
@rezuwankabir3372 Жыл бұрын
can you not just do scanf ("%s%s", &nameF, nameL) instead of using fgets?
@aditya_asundi
@aditya_asundi 2 жыл бұрын
Why vscode? Why not dev-c++, vs19 or codelite?
@BroCodez
@BroCodez 2 жыл бұрын
more people are transitioning to vscode
@Unit_00
@Unit_00 2 жыл бұрын
lmao and here I am using notepad
@dxshawn532
@dxshawn532 Жыл бұрын
Those are trash
@felipemrj.
@felipemrj. 2 ай бұрын
yoooooooooooo
@vega_yy
@vega_yy 4 ай бұрын
printf("Random comment1.2");
@big_2361
@big_2361 2 жыл бұрын
he scanfs the string with an & and it works? how?
@redemedy8602
@redemedy8602 2 жыл бұрын
if you dont put it it will modify the pointer so...
@big_2361
@big_2361 2 жыл бұрын
@@redemedy8602 no not at all. with int or char variables you use & to get their address aka get a pointer to them and change the value at which the pointer points. if you assign a pointer to a pointer with & you will only change the pointer (you will change where it points to) and that will cause an error
@vincenzo3574
@vincenzo3574 2 жыл бұрын
It works because &array is equal to array in C, if he was using a pointer to a buffer allocated with malloc it would crash
@engirckt5410
@engirckt5410 2 жыл бұрын
oh my god c is not like java at all lol
@yuhmi88
@yuhmi88 2 жыл бұрын
early!
@yuhmi88
@yuhmi88 2 жыл бұрын
thx for noticing!
@fyrukmcoo100
@fyrukmcoo100 2 жыл бұрын
:((
@khahanguyen3059
@khahanguyen3059 2 жыл бұрын
how can run input in mac os, because it isn't like your video.
@sashaktyadav7998
@sashaktyadav7998 2 жыл бұрын
I asked you a question that Which language is best for making mobile app than can control robots (Both iphone and android) ? Pls reply sir 🙏
C math functions 📚
2:42
Bro Code
Рет қаралды 30 М.
you will never ask about pointers again after watching this video
8:03
Low Level Learning
Рет қаралды 2,1 МЛН
Survival skills: A great idea with duct tape #survival #lifehacks #camping
00:27
[c][explained] Problems with scanf
6:11
theteachr
Рет қаралды 64 М.
why do header files even exist?
10:53
Low Level Learning
Рет қаралды 376 М.
C pointers explained👉
8:04
Bro Code
Рет қаралды 149 М.
Be Careful When Using scanf() in C
12:22
NeuralNine
Рет қаралды 127 М.
why are switch statements so HECKIN fast?
11:03
Low Level Learning
Рет қаралды 390 М.
C reading files 🔎
4:33
Bro Code
Рет қаралды 47 М.
How do computers read code?
12:01
Frame of Essence
Рет қаралды 3 МЛН
Игровой Комп с Авито за 4500р
1:00
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 2,2 МЛН
iPhone 16 с инновационным аккумулятором
0:45
ÉЖИ АКСЁНОВ
Рет қаралды 8 МЛН
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 6 МЛН
Cheapest gaming phone? 🤭 #miniphone #smartphone #iphone #fy
0:19
Pockify™
Рет қаралды 1,8 МЛН