C++ Tutorial – 9 – Return Values in Functions

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Comments

50 responses to “C++ Tutorial – 9 – Return Values in Functions”

  1. Blood Bluser Avatar

    0:10 LOL i thought it said
    int yourmom;
    cin >> yourmom;

  2. Mustafa al na'imi Avatar

    i don't get it, why this complicate? just mul it * 7
    still don't understand return job

  3. Aaqib Soomro Avatar

    Could someone please tell me that "What is the function of 'return'?" and "Why we use it?"..??

  4. rutger5000 Avatar

    Quick question why bother with initializing the function twice? Why bother with the line:
    "int dogyears(int)"
    ?
    From what I can understand you don't need it at all, and I don't feel like it add clarity"

  5. yyyyyyyyyyooooo1 Avatar

    could you possible return 2 values simultaneously?

  6. SerbiaComputer Avatar

    Who's watching in 2016??

  7. Karnan Crockzz Avatar

    subscribed sir . was very useful . may god bless u

  8. Davit Goderdzishvili Avatar

    where is a source code for this video?

  9. Mr Gentleman Avatar

    Lol the old Bucky videos

  10. Lincoln Johnathan Avatar

    How to return a series of numbers??

  11. Dana Richards Avatar

    Can you teach us file encryption and decryption in C++? 

  12. alaa ashraf Avatar

    thank you very much for your effort 

  13. Giovhanny Archer Avatar

    A good way to practice this is by trying to create the exact opposite (How old are you in dog years) right after watching this.

  14. (ncom86) Avatar

    We got 381 likes on the video but only 8 likes on this comment?
    The world is so unfair…

  15. DofWMaelstrom Avatar

    You need a ; after "int dogyears (int)"

  16. كلنت غرام Avatar

    Guys, do me a favor and don't use system("pause")… Using system("pause") is like burning your furniture for heat when you have a perfectly good thermostat on the wall.

    Why?
    It's not portable. This works only on systems that have the PAUSE command at the system level, like DOS or Windows. But not Linux and most others…
    It's a bad habit you'll have to break eventually anyway.

    Use cin.get() instead. All you have to do is press RETURN and your program continues.

  17. Bineet Gupta Avatar

    dude!
    your tutorials do help!!!!!!

  18. DonRiker Avatar

    I'm new also, and I don't think there is a reason to in this application. Perhaps down the road. The whole variable of dogyears isn't needed at all in this.

  19. Uday Adusumilli Avatar

    really helpful, thanx man

  20. shush your face Avatar

    did you "return 0;" at the end?

  21. lightbike vids Avatar

    im new to programming sorry to ask why would you return in another function when you can do all that in the main function just a question ??

  22. Reshurum Avatar

    You will need to know how to if you plan to program in the future.

  23. Michael Anthony Hornak Avatar

    Using Xcode instead of Dev-C++ here. The "int dogyears(int dog) {return 7 * dog;}" has to come before "int main()……" or there is 1 error for use of undeclared identifier "dogyears".

  24. Ibrahim Ahmed Avatar

    I don't really get the whole "Return values in functions" thing but I found an alternative way to make the same application in less time.

  25. Ibrahim Ahmed Avatar

    I LUV DEEZ TUTORIALZ!!!

  26. Vishal Malpure Avatar

    thnx a lot……….

  27. Katana Firey Avatar

    @2 below
    My brain hurts O_o

  28. Frozen Flame Avatar

    so the integer "years" takes the place of dog which is passed to the function dogyears for the function to use in the calculation which is the return statement, which returns the value of dog years back to the main function to print. Just get back to me in case I got anything wrong.

  29. jan80808 Avatar

    great vid learned alot.

  30. saw0man Avatar

    man I <3 your work
    thx

  31. matemaatikko141 Avatar

    Your videos would be a lot better if you had your whole screen on the video instead of having to move back and forth all the time

  32. Oleg Maslakov Avatar

    Yo Bucky Im gonna make sure to click on every AdWord, this is the best channel for C++ HANDS DOWN! :)))

  33. axtya X Avatar

    thumbs up if bucky is AWSOME!!!

  34. axtya X Avatar

    by the way, your the one who taught me c++!!!

  35. axtya X Avatar

    thx bucky for letting my vid response through,its a big help!

  36. qzer1990 Avatar

    Hey I'm kinda confused and a newbie. Can anybody explain me again the purpose of the variable dog, please? And why doesn't it have to be declared like i.e int people years?

  37. Meat Shackles Avatar

    I'm new to programming and this is awesome I love that someone posted all this stuff it really helps thank you

  38. Jay Anderson Avatar

    Just follow the tutorials. Be patient. You need to learn all of these things first. Eventually, he will get there.

  39. chickhunbone Avatar

    I don't see how this basic math shit can lead to something like a game, or a usable program… Game programming guide please?

  40. ganzi321 Avatar

    I got an error because of into dogyears(int);

  41. SwordedWings Avatar

    I'm using the line cin.get(); instead of system("pause") as people have suggested, it has worked out pretty nicely but for some reason it doesn't here. As soon as I enter the number, the command thingy closes, is it because i press enter? Help would be appreciated!

  42. NarutoAOF Avatar

    I can't seem to understand the difference, its like all functions are doing the same thing!

  43. jack01098 Avatar

    Thanks dude i was struggling with that a bit. 🙂

  44. JapaneseTentacleRape Avatar

    That was genius lol ive had such a hard time with what return does. Thank you

  45. Jonathan Purdy Avatar

    @MrPapsy18 Yep, basically when you declare the function your telling the compiler what to expect the function to return, then naming the function, and then telling the funtion what input it can expect. You can still use the int for a function that doesn't return anything, but you would need to put return 0; at the end of the function. At least that's what i've seen.

  46. Whoa - neo Avatar

    @greekpanther1 Lol me too myfun(yourmum)

  47. Gabriel Lozada Avatar

    'dogy ears'… hehehehe

Leave a Reply

Your email address will not be published. Required fields are marked *