C++ Tutorial [12] - Getting Console Input from the User

preview_player
Показать описание

Code: Coming Soon

More Videos coming soon.
Leave a comment for any future video suggestions.
Рекомендации по теме
Комментарии
Автор

20:58 dont want to be a know it all here but just for the people who want to learn C in the future - because there these so called "escape sequences" are REALLY important - '\n' is not the NULL-Terminator, that would be '\0' and is automatically (in C++, in C you need to do the escape sequence stuff by yourself! thats why its so important) added at the end of every string to terminate it. Its the reason why a string (which is just a char-array) always takes at least one more char then needed for the stored text. What we are seeing here, the '\n' is the "new line sequence" - it occurs when pressing the enter-key but also 'endl' basically is just '\n'.
Again: I really dont want to be smart-alecky here - this is just way too important of a topic if you want to get into C and technical programming/embedded systems :P

allmyinterests
Автор

I have learned so much from THIS ONE... thank you :)

Gryffon
Автор

i switched to this new IDE, available if you have a student email, ok so let's get user input so if they are 18 you take them to xxx 🤣 the transition was casual af

uliveulearnandregret
Автор

I like your tutorials bro ashdsahshdhds

kxptxn
Автор

Super quick question if you know the fix to this...

I created a program such that it asks for 3 things. Your name( I used getline to ask for user input)
I then asked the user for their age(I used cin>>age) for this, and lastly I asked what their favorite dessert was(I used getline to ask for user input)

My issue is that it didn't allow for user input on the dessert part of it. Is there a way to fix this?

joelduran
Автор

with VS it seems we dont need to add the &: for the getline command. Why ? And do you recommend VS code ?

orangebrandon
Автор

I'm confused on why you would add the number 45 "int age = 45;" guessing size of number is irrelevant, and you're just letting console know you want a digit and not a string?

devinpaulsen
Автор

every time i try to use cin.get exactly as you showed so it doesn't work and doesn't want to turn on... Can someone help me?

ondrejmalek
Автор

Did you say, if they are 18 you can take them to the porn site? LOL

laura-jadebrooks
Автор

I don't know what you say. You speak very fast.

mldhai
Автор

"Hopefully I didn't mess up that explanation"
lol yea your screwed up the explanation big time bro. Maybe like, write a script next time?

uhJerryJackson
join shbcf.ru