Does anyone else go ahead and make what he does in every tutorial more complex? this one for example i made it so i enter the numbers and there not pre-set, i think its good for learning.
@TheElectricEchoes In the printcrap() function, it had code in the function that printed it out to the screeen so there was no need to use cout, also, that function was void which means that it returns no value, so it couldn't be printed to the screen in the same way as the addNumbers() function. In the addNumbers() function, it returned a value and he used cout to print that returned value to the screen. Hope that made sense!
@RSFireworm999 To make it more versatile, if you don't return it you can only use it inside that function, so if you want to output it outside the funtion it wont work.
@RSFireworm999 you can just cout it for simple functions like that, but what if you don't want it printed to the screen and instead you want it to give you a number that you can use in another calculation? int addNumbers(int a, int b) { int sum = a + b; return sum; } void divide(int x, int y) { answer = x / y; cout << answer; } int main() { divide(50, addNumbers(50, 30)) return 0; } Hope this makes sense! :)
@n3ffey you would use it if you had to reuse the new function later on in the program. Rather than having to declare all of the values again, you can quicken the process by using the function with the parameters for example int add (int x, int y, int z,){ cout<< x + y + z } int main () { cout << add( 4, 5, 6); cout << add (11,32,45) } that is a lot quicker and easier than retyping all of the variables, especially if there are tons of numbers to input
can someone tell me whats the point of the return i tried the program with and without return but it runs the same can someone please tell the use of the return
guys.. sombody pls.. wat shud i do if i had to get the values from the user.. its really pissin me off.. nth comes to my mind.. anybody??? help me out..
@lvlycreator92 You'll make a variable that takes the input from the user, then you'll "pass" these variables to your function. I could be wrong, but I think the variables have to be different then the functions parameters.
Is it bad to put my other methods under my main? I like keeping the main on top, I'm just worried that it might get confusing with more advanced tutorials or with working with other programmers.
@PorifersAnims Its a matter of practice. You pretty much always use it after declaring variables, and after using the asignment operator. Also at the return statement. You also use it when you're declaring a function. There are more stuff when you use them but you're probably not at that stage yet, like when using classes. int function(); main() { cin.get(); return 0; } int function() { int number; number = 9; return number; } hope that helps.
I have start to see this Tutorial for 3 hours ago, and I now almoust nohting, now make a calculator that I can type in valuesin the run, and choose whether to write plus, minus, multiply, or divide. and it does not stop there, to continue on, say your guide is valuable and informative:) I go to nexst tutorial:)
@rainbowcrak If you do that, it only shows the return in the compiler command line. If you try running the compiled .exe file in a cmd.exe window, it doesn't show the return.
sense of humor and free education. Bucky u the man!!
Ghoatek99 4 days ago in playlist C++ Programming Tutorials Playlist
we love you. rap!
tomahawkren 5 days ago in playlist Bucky's C++
pretty cool huh :\
YamamotoYuriify 6 days ago in playlist C++ Programming Tutorials Playlist
I made that user enter numbers so it's a basicly simple simple calculator. :D
cnrhs6 1 week ago in playlist C++ Programming Tutorials Playlist
you're saving my life in my C++ class. thank you god!
kidcofuzed 1 week ago in playlist C++ Programming Tutorials Playlist
I wish my lecturer teaches as good as you. LOL
dudecanner 2 weeks ago in playlist C++ Programming Tutorials Playlist 2
Does anyone else go ahead and make what he does in every tutorial more complex? this one for example i made it so i enter the numbers and there not pre-set, i think its good for learning.
PhishTaco9 2 weeks ago in playlist More videos from thenewboston 3
@PhishTaco9 i do that too :b
iDer0x 2 weeks ago in playlist C++ Programming
@PhishTaco9 I made a very basic calculator lol
CloudDecim 1 week ago
Oh oh oh, HEY GAZZ WASSUP?
CanadianTechHelps 3 weeks ago 2
CRINGE AT START!
HardlyMinecraft 3 weeks ago
Comment removed
filip011001 1 month ago
intro:ugh ugh ugh,
hey guys, WOTS upppp
welcome to your
eleventh tutorial
and in this
tutorial
hahahahahahahah
orfmor 1 month ago 6
"Let's make some magic happen baby" - that's what he said...
BobbieD96 1 month ago in playlist Buckys C++ Programming Tutorials Playlist
Now let's make some magic happen!
HighFlyingBattery 2 months ago
bahaha nevermind, I shouldn't have paused it and went into a panic! as soon as I pressed play you explained is :L
TheElectricEchoes 2 months ago
Why do you use Cout for multiple parameters, but if you have a single parameter you don't?
In the last video you just printed the functions name in main
printCrap(12);
but this time
cout << addNumbers(43, 86);
I assume if your returning a value you use cout to print to the console? I'm not entirely sure xD
TheElectricEchoes 2 months ago
@TheElectricEchoes In the printcrap() function, it had code in the function that printed it out to the screeen so there was no need to use cout, also, that function was void which means that it returns no value, so it couldn't be printed to the screen in the same way as the addNumbers() function. In the addNumbers() function, it returned a value and he used cout to print that returned value to the screen. Hope that made sense!
SeanRamey 2 months ago
You fucking rule bucky
ronami101 3 months ago
the C99 standards defines that you should be able to use at least 127 arguments.
cheers !!
terfy 3 months ago
x !! y ???.. because I fuc.... Z so
terfy 3 months ago
I don't really get the return part. I don't get why it's so important and why that's the difference between void and int.
using namespace std;
int addnumbers(int x, int y)
{ int answer = x + y; cout << answer;
}
int main()
{ addnumbers(7,9); return 0;
}
I tested it and it worked so why do you have to use return and not just cout it?
RSFireworm999 3 months ago
@RSFireworm999 ugh youtube messed up my brackets and spaces etc but you'll get it >_>
RSFireworm999 3 months ago
@RSFireworm999 To make it more versatile, if you don't return it you can only use it inside that function, so if you want to output it outside the funtion it wont work.
erikhoj1996 3 months ago
@erikhoj1996 thx
RSFireworm999 3 months ago
SeanRamey 2 months ago
@SeanRamey holy cow, well sorry.. youtube didn't print it like I had it... now it really won't make sense... sorry...:(
SeanRamey 2 months ago
@RSFireworm999 bucky knows what hes doing :D
CloudDecim 1 week ago
@CloudDecim no doubt he does,
they've already answered my questions anyways :)
RSFireworm999 1 week ago
oh yeah pretty cool huh. :)
redcodeful 4 months ago
aloivnevets 4 months ago in playlist Buckys C++ Programming Tutorials Playlist
Do you need the (return answer;) ? - Thanks is advance for the answer!
Guywhowatchesvideos8 4 months ago in playlist thenewboston c++
donn everr everrrr.... try to sing ...
SidTitus 5 months ago in playlist More videos from thenewboston
@conflustered thanks!
kojax98 5 months ago
great tutorials, bucky, but I wonder, how do I declare a variable with string (text) value
kojax98 5 months ago
@kojax98 underneath #include iostream add #include string then declare the text as a string
ShagenHD 5 months ago
You're a pro!
Dombamatic 5 months ago
Bucky you forgot to tell us we can replace the parameters for a variable once in the main function.. :D
vaironxxrd 6 months ago in playlist TheNewBoston - C++
can someone tell me whats the point of the return i tried the program with and without return but it runs the same can someone please tell the use of the return
AtomicRagProductions 6 months ago in playlist C++ Programming
@AtomicRagProductions If your function's data type is anything but void, you need a return to end the function
ResidentBiscuit 6 months ago
why arent these vids in a playlist? i really wanna save them all.
MrKilltastic 6 months ago
This has been flagged as spam show
@MrKilltastic i have a playlist of these in my account. you can get it at /playlist?list=PL96ED5F4FC5EA8F7D
montywh 6 months ago in playlist Bucky's C++ Tutorials
wtf was the beginning?..
lost a bet?^^
MrJebiga1 7 months ago
Hey You! Hey Guyz!! rock and roLL.. Oh Oh Oh yeah!!
eminemchu43 7 months ago
guys.. sombody pls.. wat shud i do if i had to get the values from the user.. its really pissin me off.. nth comes to my mind.. anybody??? help me out..
lvlycreator92 8 months ago
@lvlycreator92 cin >> x;
that's assuming x is the variable you want to use
go back and watch the older videos.
hbaderman 7 months ago
@lvlycreator92 You'll make a variable that takes the input from the user, then you'll "pass" these variables to your function. I could be wrong, but I think the variables have to be different then the functions parameters.
ResidentBiscuit 6 months ago
@ResidentBiscuit
there is difference between local and global variables
scofieldforlife 6 months ago
3:10- But what if you do 0+0? :P
chester10999 8 months ago
@proudTBeGreek .. am sory. yeah i actually meant cin>>
lvlycreator92 8 months ago
What function type would I use to return a string?
739199 8 months ago
what shud i do if i had to get the values from the user???
i ve tried puttin the cout<< in al posible place!! can u xplain?? :)
lvlycreator92 8 months ago
@lvlycreator92 maybe you mean cin>> ??:S!
ProudTBeGreek 8 months ago
If you don't use "return answer;" it will still work. What is the real use then of "return answer;".
Masteryxx 8 months ago
bucky, i want you to make love to me in C++
Lunaticpandora101 9 months ago
in song? u call that song bucky? :S
jakiesnakie1 9 months ago
Gaah! Spent thirty minutes looking for mistakes because I kept getting some kind of error. I forgot to change void to int... =P
Vortex289 9 months ago
lol at intro
xXxDiukexXx 9 months ago
What about parameters like inta, int b, ... int x ??? I mean function with parameters like dots [...] and then the last one.
Krisler12 9 months ago
Is it bad to put my other methods under my main? I like keeping the main on top, I'm just worried that it might get confusing with more advanced tutorials or with working with other programmers.
DjZephy 9 months ago
@DjZephy as long as you prototype those functions, ur all good ;)
skychy 9 months ago in playlist C++ Programming Tutorials (thenewboston)
LOL
i keep getting errors because of the ;
-.-
PorifersAnims 9 months ago
thesickbeat 9 months ago
ok the beginning was soo gay:P....
caspowns 10 months ago 23
@caspowns Y U CALL TEACHER GAY
CloudDecim 1 week ago in playlist C++ Programming Tutorials Playlist
I have start to see this Tutorial for 3 hours ago, and I now almoust nohting, now make a calculator that I can type in valuesin the run, and choose whether to write plus, minus, multiply, or divide. and it does not stop there, to continue on, say your guide is valuable and informative:) I go to nexst tutorial:)
TheTosa3000 10 months ago
4:49 thats what she said.
coder1997 10 months ago
@ zuberguber105 i ate it.....
wasab1z 10 months ago
Couldnt you have just done 'return x+y;' instead of using an answer varaible?
rainbowcrak 10 months ago
@rainbowcrak If you do that, it only shows the return in the compiler command line. If you try running the compiled .exe file in a cmd.exe window, it doesn't show the return.
GreeblyChicken 9 months ago
hey i need help...... i did all of thos,but when i start a program, it just flashes on my screen..um...how do you keep it on the screen?
gojatheking 10 months ago
@gojatheking if ur using dev c++ u need to use system("pause"); in the main function to keep it on the screen
lifetycoon101 9 months ago
I've learned so much.
You Rock Bucky!
Fbiman93 10 months ago
dont you have to use cmath to calculate numbers?
siva18visu 10 months ago
@siva18visu I think you only need it for complicated calculations like log and ln (I think)
keez1994 10 months ago
@siva18visu
The cmath library is just for certain syntax's like pow, sqrt, sin, cos, tan, etc.
Addition, subtraction, multiplication, etc are in the iostream library.
ChasLough 10 months ago
At the beginning of this tutorial I thought he was high or something xD
TheAlascar 10 months ago
This has been flagged as spam show
Pretty cool, huh?
fanreymysterio619 10 months ago
Comment removed
Manishel 10 months ago
thanks for new tutorials!!!!!!!! woohhhooo
JJinos002 10 months ago 54
Excellent tutorial , nice and easy to understand . Keep them comming . Thank you.
faiyaz786khan 10 months ago
exuse my French, but what the fuck happened to JavaScript???!
Zuberguber105 10 months ago 38
@Zuberguber105 Hey, i wan't to build a game engine, JavaScript is a piece of shit when making apps, but it's the best in simplicity and scripting.
SergeantNugget 7 months ago
@SergeantNugget Ever tried Python? Simplest scripting language, ever.
MrApplseed 6 months ago
@Zuberguber105 HE NEVER COMPLETES ANYTHING wtf!
casa2565 3 weeks ago