No video

C++ Tutorial - 5 - cin and User Input

  Рет қаралды 191,720

thenewboston

thenewboston

Күн бұрын

Source Code: github.com/the...
Core Deployment Guide (AWS): docs.google.co...

Пікірлер: 140
@nathancarpenter8895
@nathancarpenter8895 4 жыл бұрын
Wow explained so much better then my college professor.
@onlywayisforward
@onlywayisforward Жыл бұрын
Indeed.
@DevPatelDowntownScience
@DevPatelDowntownScience 10 жыл бұрын
For those who finished till now, make a program for a calculator! here's mine: #include using namespace std; int main() { int a; int b; cin >> a; cin >> b; cout
@dylondragon
@dylondragon 13 жыл бұрын
"its my favorite number so deal with it" lol
@Slywolf1992
@Slywolf1992 13 жыл бұрын
These videos are perfect when studied along with C++ Without Fear version 2
@xxYetterxx
@xxYetterxx 12 жыл бұрын
Learning from scratch and so far yours are the best tutorials I've come across so good on ya.
@onlywayisforward
@onlywayisforward Жыл бұрын
I bet your good at it by now.
@skidpanking
@skidpanking 13 жыл бұрын
Great stuff. Helping me through foundation degree. Best C++ video yet.
@onlywayisforward
@onlywayisforward Жыл бұрын
Agreed
@YZB25
@YZB25 13 жыл бұрын
thanks for the simple, to the point tutorials... Me and my friend are 12 and 13 and we both understand this
@adamtheblessed1
@adamtheblessed1 14 жыл бұрын
Your awsome dude. I tried learning programming from those sites from India. I gave up on India sites. It was like trying to understand a man from Mars. I can understand you perfectly.
@DhDo74
@DhDo74 15 жыл бұрын
Thanks for being so helpful, I will use your videos to help me for my next semester in college! 5/5
@zonefree156
@zonefree156 15 жыл бұрын
Thx alot your vids are great keep it up. Im gone go through the whole series.
@Manwith2life
@Manwith2life 13 жыл бұрын
tutorial 1-5 my first 3hours of programming lectures and seminars condensed into about 25mins
@kikerisa12
@kikerisa12 14 жыл бұрын
Thank you you make it really easy to learn. much appriciated
@jniroshsl
@jniroshsl 13 жыл бұрын
Hi bucky, I'm very proud of u. great job. well presantation. continue.... thanks for the tutorial.
@bogslonca
@bogslonca 13 жыл бұрын
COUT >> - Program is sending or is going to send some informations (send OUT) CIN
@awadmustfa9173
@awadmustfa9173 4 жыл бұрын
wow 12 years full of memories
@berniceyap3897
@berniceyap3897 3 жыл бұрын
you explained better than my high school teacher lolol
@5thethriller
@5thethriller 14 жыл бұрын
very good thanks would like to see some more tutorials on more advaced stuff, that would be great
@Ganahim
@Ganahim 15 жыл бұрын
Your videos couldn't be more clear =) thanks m8.
@ej0080
@ej0080 15 жыл бұрын
C++ is a coding language that tells the computer to "do stuff" you can make games, hacks for games programs for anything else with it
@PilotCube
@PilotCube 15 жыл бұрын
TheNewBoston is making an army of programmers!! I love it!
@aperson8215
@aperson8215 4 жыл бұрын
Agreed, 10 years later HAHAHA
@hetaeramancer
@hetaeramancer 2 жыл бұрын
according to the US constitution it is illegal to muster your own army
@sadnessinmylife
@sadnessinmylife 12 жыл бұрын
One cool tip peoples: Just so the output is neater, do not put endl after the first cout when you're asking the user. This way, once you're running the program, you can input a value right after the question is.
@3croN
@3croN 13 жыл бұрын
Thank you !
@klajdimyftari4691
@klajdimyftari4691 5 жыл бұрын
thank you very much!!
@BiggBenn56
@BiggBenn56 13 жыл бұрын
Great tutorials. Thanks a lot
@MrCavalleri
@MrCavalleri 15 жыл бұрын
another good tutorial! nice and fast!
@1000nateriver
@1000nateriver 9 жыл бұрын
thanks really much helped me a lot
@MilleniumAtheist
@MilleniumAtheist 13 жыл бұрын
It surprises me that you didn't mention string variables a single time here.
@AMMstudios
@AMMstudios 15 жыл бұрын
im 12 and im working with this! GREAT JOB! 5 STARS! :D
@bobbytheferret6809
@bobbytheferret6809 3 жыл бұрын
Yo how's ur career going?
@PyroDokuu
@PyroDokuu 12 жыл бұрын
I used to make arrow to the knee jokes until i took the arrow to the knee.
@lowIQ04
@lowIQ04 13 жыл бұрын
Int Variable; Variable = Awesome; cout
@spyroglitcher
@spyroglitcher 13 жыл бұрын
i tryed a different method of my own to see if it worked, i changed like 2 lines around and it works! i cant believe im ACTUALLY learning coding now!!! instead of gregsnum = gregsnum + 20 i just put cout
@MrArteez
@MrArteez 6 жыл бұрын
how is your coding adventure going?
@GM-rx5jo
@GM-rx5jo 6 жыл бұрын
can you add all of your coding from declaring variable through cin command so that I can understand how it worked. don't get mad at me:)
@Bettehem
@Bettehem 12 жыл бұрын
To make it output Your number is 26. You will have to code following: cout"your number is "gregsnum"."endl; Notice that there has to be a space between is and ". Otherwise it will look like this: Your number is26.
@TheVista1995
@TheVista1995 12 жыл бұрын
@BadGamingYT You forgot ";" at the end :P
@papano12
@papano12 15 жыл бұрын
Greg, ur vids are good man, keep it up.
@Abdulrahman-uk9ny
@Abdulrahman-uk9ny 5 жыл бұрын
Freaking awesome simple hahaha
@questionman5
@questionman5 15 жыл бұрын
The "press a key to continue" in the cmd window is caused by the line of c++ code before "return 0;". the part where it says "system("pause"); causes it to say press any key to continue. did i answer your question or no?
@kIPTOX
@kIPTOX 13 жыл бұрын
cout
@MalakaiPrograms
@MalakaiPrograms 6 жыл бұрын
You can also use string, if making a user and pass.
@eggxecution
@eggxecution 5 жыл бұрын
THANKS A LOT!
@xBl00dBrothersX
@xBl00dBrothersX 13 жыл бұрын
SWEET video!
@mcSavagekilla
@mcSavagekilla 12 жыл бұрын
cout -- "you make this very easy to learn; --endl;
@IANR632
@IANR632 12 жыл бұрын
I used to program computers.... but then I took an arrow to the knee!
@Funtasmia
@Funtasmia 13 жыл бұрын
@g33ky898 actually, I recall it as console input, and console output :P
@kurrethegs
@kurrethegs 13 жыл бұрын
if you used cin.get (); instead of system("pause"); you have to type cin.get(); two times instead of one.
@DeveloperMarty
@DeveloperMarty 12 жыл бұрын
thenewboston maybe u shud tell people that u can add another integer and name it blah (for example) then u can say cout
@Tokiopopski
@Tokiopopski 13 жыл бұрын
@Tokiopopski nvm, using cin.get() again fixes it
@Tokiopopski
@Tokiopopski 13 жыл бұрын
Using cin.get() instead of system(pause) the program closes as soon as I hit enter (to enter my input), what do?
@josnardstorm
@josnardstorm 11 жыл бұрын
You always start off quiet and not so energetic, but then you pick up as you go through the video.
@Nuclearbomb8900
@Nuclearbomb8900 14 жыл бұрын
Greg is such a num-nuts.
@Adelbert1309
@Adelbert1309 13 жыл бұрын
how to syntax if I want the user input to be not visible or it will not print out on the screen while they are typing it and after but the program will read it?
@thenishanth420
@thenishanth420 13 жыл бұрын
@deenotheman2 Follow the boss Bucky when you are watching his tutorials :D
@zehawk1
@zehawk1 12 жыл бұрын
Cant you do a system.in().function in java instead of importing scanner all the time? I was just curious, not saying Scanner isnt hard, but it seems ineffective to use all the time...
@hsdgkas
@hsdgkas 14 жыл бұрын
Error: The system cannot find the file specified.. :( pls hlp (this also in compile log Compiler: Default compiler Executing g++.exe... g++.exe "C:\Dev-Cpp ew.cpp" -o "C:\Dev-Cpp ew.exe" Execution terminated
@UNSFRenegade1
@UNSFRenegade1 13 жыл бұрын
i know you probably dont read comments from these old videos, but how much mathmatical knowledge do you need to become skilled in C++. Cause i would like to do a Unversity course in C++ and you need a high qualification in mathmatics, but i can do an exam after year 1. but is it difficult to understand and use effectively. Thanks :-)
@TheUkeKid101
@TheUkeKid101 11 жыл бұрын
I GET IT!!! c-INPUT = cin c-OUTPUT = cout
@sonneh88
@sonneh88 12 жыл бұрын
Actually you can declare a variable and give it a value in the same line like that. =b
@oldtimegamelover
@oldtimegamelover 14 жыл бұрын
When I type system("pause"); it doesnt work. I tried it with a space and no space between system and pause's perenthis. Thx! :)
@Left4pillz
@Left4pillz 13 жыл бұрын
@boogieman626 Check that you have put the semicolon at the end of the previous line
@diapysik
@diapysik 13 жыл бұрын
@g33ky898 yeah useing exactly what the code means is a good way to remember it.....
@thisuserhas
@thisuserhas 14 жыл бұрын
First off Thanks for the tuts - just a quick question with the cin function I was playing around and if you don't enter an integer (as gregsnum was declared int) one of the following seems to occur Number value - converts to int (i.e. 3.3 --> 3) string/char value - doesn't change default value of 2. Is this normal - are there futher rules that should be taken into consideration??
@jeffery12108
@jeffery12108 14 жыл бұрын
cin.get() doesn't work when stopping the program D:
@zehawk1
@zehawk1 12 жыл бұрын
Cause In this tut it appears that yu can use cin(C++ version of system.in from java) and seeing as how both langs r similar, itd make sense
@sportsguy831
@sportsguy831 13 жыл бұрын
great tutorials but i have a question. I copied the code exactly as you have it on the screen, but it still comes up with errors. I did not copy anything wrong or make nay typos. Im using Microsoft C++ 2010, and I have no idea what i did wrong
@SeeEssThree
@SeeEssThree 13 жыл бұрын
What's the difference between c, c++, c# etc?
@Decodeish1
@Decodeish1 12 жыл бұрын
cin >> whatevertheintis; doesnt work for me D: The program '[9128] name.exe: Native' has exited with code 0 (0x0).
@ashutoshsingh8907
@ashutoshsingh8907 3 жыл бұрын
Wow so old comment section
@nateforlaw
@nateforlaw 11 жыл бұрын
I MADE A COUCULATOR THAT ADDS AND SUBTRACTS! WOOO!
@AMMstudios
@AMMstudios 15 жыл бұрын
ya i know dude. that was a week ago when i post that lol i know way more stuff now :D lol
@Sammysapphira
@Sammysapphira 15 жыл бұрын
woot same here!!!!!
@jeffery12108
@jeffery12108 14 жыл бұрын
@bubinasuit It doesn't work when you are using cin>>
@omegapixelled
@omegapixelled 11 жыл бұрын
Command-Input = cin Command-Output = cout
@09106073576
@09106073576 15 жыл бұрын
did you get a solution from the newboston about ur prob? i got errors too.. im just waitin' for him to respond. T^T
@D34tho
@D34tho 15 жыл бұрын
why not all of your videos in one ??
@MrJepcats
@MrJepcats 13 жыл бұрын
You can just use char f; cin >> f if using cin.get() is problematic.
@maam31
@maam31 15 жыл бұрын
hey how do i get it to add a random number?
@MrMusta95
@MrMusta95 13 жыл бұрын
what does 'gresgsnum' mean? can somebody answer please?
@AbramacP
@AbramacP 15 жыл бұрын
the best!!!!!!!!!!!!!!!!!!!!11 :) verry nice
@bigestsum41fan
@bigestsum41fan 15 жыл бұрын
i kept forgetting the f'ing ;;;;;;;; and i wasn't sure what i was doing wrong
@chris12x1
@chris12x1 15 жыл бұрын
in this line gregsnum = gregsnum +20; my error is: C:\Documents and Settings\chris diaz\Desktop\c++ learning ew2.cpp In function `int main()': 12 C:\Documents and Settings\chris diaz\Desktop\c++ learning ew2.cpp expected `;' before "gregsnum"
@MrSaemichlaus
@MrSaemichlaus 11 жыл бұрын
Hey, I have a question! Is there a command which lets the user enter one single number or letter ( like char ) and then takes it in instantly without having to press Enter?
@sportsguy831
@sportsguy831 13 жыл бұрын
youtube wont let me post the code
@Aman78628
@Aman78628 12 жыл бұрын
thnx man really appreciate you! cout
@r3sp3c791
@r3sp3c791 15 жыл бұрын
yea! it's not like some shity books or tutorials which just tell you to write down the code and they don't exaplain anything...
@shadowprimita
@shadowprimita 13 жыл бұрын
@sportsguy831 I had that problem too, but then I installed the program again , and it worked , but my program is Dev-c++, I hope this solution can help you too.
@Wowccraft
@Wowccraft 15 жыл бұрын
youtube doesn't allow more than 10 minutes of video
@Mangputt
@Mangputt 2 жыл бұрын
This video published at i'm 5 y.o
@whatnottodo5943
@whatnottodo5943 6 жыл бұрын
If i want to make it to where the user inputs a word, such as a name, what would i use? Like i have variables that the user inputs a word but i can’t get it to work with cin (i also don’t know the code for assigning a text input to a variable)
@omara6899
@omara6899 5 жыл бұрын
You put #include
@omara6899
@omara6899 5 жыл бұрын
and then make a string example: string a; cout > a;
@adaptiiq3843
@adaptiiq3843 5 жыл бұрын
First you need to include "string". You can do that by adding it on the top under iostream "#include . Then you need to add it to your code: string word = " ";
@mouniswar7
@mouniswar7 7 жыл бұрын
Hey Man is it possible to Skip User Input in C++(I Mean Don't Giving Input)?
@techgeek9340
@techgeek9340 15 жыл бұрын
@Wowccraft...in his case he could do a video that is more than 10 mins..because he is sponsered..do yea..he could..but me..no..
@lawlawlawlawlawlolz
@lawlawlawlawlawlolz 12 жыл бұрын
13 people have windows 98...F**KING WINDOWS 98!!!
@benweeks10
@benweeks10 11 жыл бұрын
Does the using namespace.std need to be in the body
@RustamAli-q8y
@RustamAli-q8y 19 күн бұрын
I don't understand
@Qwetyuiopzdt
@Qwetyuiopzdt 9 жыл бұрын
I want to make a simple program where it starts up and says hello (my name) where (my name) is it will insert the name I gave it the first time I ran the program please help
@olekristianmller-hansen4220
@olekristianmller-hansen4220 8 жыл бұрын
+Qwetyuiopzdt I think your best bet is to use file streams to write and read to a text file that is stored to your drive. Variables within the program are stored in your RAM and are deleted once you close the program.
@DevPatelDowntownScience
@DevPatelDowntownScience 7 жыл бұрын
What I'm understanding is you want the program to remember some data, here, you can save to a notepad file. I might be a bit late, however.
@Vic12876
@Vic12876 14 жыл бұрын
Thanxxx
@11McMuffin
@11McMuffin 12 жыл бұрын
Before you try to troll, I'd like to point out one flaw. You spelled "video" wrong, Before you troll; Correct your spellings :>
@friedchicken1
@friedchicken1 15 жыл бұрын
agreed
@257joker
@257joker 13 жыл бұрын
@g33ky898 thats how i did it
@fsphinx2
@fsphinx2 10 жыл бұрын
Just deal with it! ;p
@chaoselites3636
@chaoselites3636 6 жыл бұрын
I maxed my volume and still couldn't hear the audio very well.
@gio9527
@gio9527 5 жыл бұрын
thos was recorded in 2008 and i can hear it perfectly
@GodIzDaLight
@GodIzDaLight 8 жыл бұрын
I know this an old video but can you do, if cin =? So cin inside of a if loop?
@adaptiiq3843
@adaptiiq3843 5 жыл бұрын
Yes.
C++ Tutorial - 6 - Beginning Functions
5:56
thenewboston
Рет қаралды 193 М.
User Input With cin Basics | C++ Tutorial
10:04
Portfolio Courses
Рет қаралды 7 М.
Harley Quinn's plan for revenge!!!#Harley Quinn #joker
00:49
Harley Quinn with the Joker
Рет қаралды 33 МЛН
Survive 100 Days In Nuclear Bunker, Win $500,000
32:21
MrBeast
Рет қаралды 161 МЛН
Doing This Instead Of Studying.. 😳
00:12
Jojo Sim
Рет қаралды 35 МЛН
Learn Any Programming Language In 3 Hours!
22:37
Code With Huw
Рет қаралды 345 М.
C++  Tutorial: Mixing cin and getline // (and how to fix it)
13:44
Professor Hank Stalica
Рет қаралды 8 М.
why are switch statements so HECKIN fast?
11:03
Low Level Learning
Рет қаралды 403 М.
how Google writes gorgeous C++
7:40
Low Level Learning
Рет қаралды 854 М.
cin.get, cin.putback, and cin.peek()
7:55
Robert Martin
Рет қаралды 37 М.
Compilers, How They Work, And Writing Them From Scratch
23:53
Adam McDaniel
Рет қаралды 153 М.
why do void* pointers even exist?
8:17
Low Level Learning
Рет қаралды 353 М.
C++ Tutorial - 12 - For Loops
5:16
thenewboston
Рет қаралды 422 М.