Easy Programming - Beginner C++ Tutorial - Value Returning Functions (18)

preview_player
Показать описание
Today I show you how to use Value Returning Functions in C++. Functions can come in very handy. Here I show you how to use return functions and use the Pythagorean Theorem Program that I created several months ago and I turn the calculation into a value returning function.

In the future, I hope to provide you with more complex programs consisting of value returning functions as well as introduce to you the Void Function which comes in very handy as well. If you have any questions about the program or functions in general, feel free to ask.

I hope you enjoy the video and if you have any requests feel free to let me know. Thanks for watching and remember to subscribe!

#EasyProgramming #ProgrammingTutorial

-----------
Рекомендации по теме
Комментарии
Автор

I was so lost, until I came across your video.. Perfect explanation :D Thank you! 

TheSha
Автор

Thank you for making this video!
I was forgetting to declare my variable in both the main function and the float function I was using.
Thank you much. It was driving me crazy

NumbinBlack
Автор

@anatita29 I'd recommend void functions because you can send multiple values back through the parameter. You can also use arrays with void functions too which would make your program much easier to do.

Good luck.

naztronaut
Автор

I'm using Dev C++, which everyone recommends against, but I haven't had any problems with it so far.

Direwolf
Автор

i did a slot machine once and i had a ton of functions for it - that was in javascript thou

EdadTace
Автор

@njoker555

Dev is bad/not recommended for these reasons:

-its no longer being updated, so that means its outdated
-when you use key words the color is just really dark black and personally I find it a bit messy
-the UI itsn't the greatest

Those are just mine and some friends opinion about it. Although if you want to use it its a free country :D

eca
Автор

@Nazmus Nasir @ anatita a.c. I have the exact same problem. Whenever I try to return a string, my complier pitches a fit. Also is it possible to return multiple values?

Direwolf
Автор

What compiler are you using?

And you can return multiple values by reference, you can check out my Void Functions tutorial which shows you how to do that. With the return function here, only one value will be sent back.

naztronaut
Автор

You are collecting the name and grade for each student in a course. Write following functions:getName - gets the student's name and returns it
SO WHAT FUNCTION YOU CAN SUGGEST ME


anatita
Автор

i can return string or char PLIZZ HELP ME I HAVE SOME PROBLEM WITH FUNCTION

anatita
Автор

@anatita29 you can't return it? Feel free to PM me the code, I'll be happy to take a look if you'd like.

naztronaut
Автор

No matter what numbers i put in, the answer is always am i doing wrong

iiNGHMRii
welcome to shbcf.ru