+ 8

FUNCTIONS ?

I have started functions in C++ from the very beginning but during the very first lecture i was confused.I was unable to understand anything about functions 😭😭😭 Would you please like to put me on path to functions ? You just have to told me 👇🏻 introduction to functions ? 👇🏻 Definition of function. 👇🏻 declaration of functions. 👇🏻 Function Call 👇🏻 Return type of function . Just Explain Briefly .

23rd Jun 2018, 9:45 AM
Shehroz Irfan
Shehroz Irfan - avatar
13 Antworten
+ 6
Ok ... the functions is something to make your code simple to read and shortcut the code .... Ok if you want to repeat a code many time you have to make a function for example : (From real life but it thr same as programing) you love coffee and you make coffee every day so you repeat this work ... Ok lets see this function >> void coffee make () { cout << "get coffee"; cout <<"get water"; cout << "put the water on fire"; cout << "add coffee"; cout << "put coffee in cup"; } if you want to repeat these commands many times you just need to call the function many time not to write cout <<"get coffee"; cout <<"get water"; . . . etc so this shortcut alot if you want to repeat it many times to call the function you just need to write the name of the function and (); for example coffeemake (); the computer will do all cout command that i wrote before so you have to define the function before use and out side of the main function .... .. am sorry if i made english mistakes ... am not english man
23rd Jun 2018, 6:30 PM
Mohammad Alshareef
Mohammad Alshareef - avatar
+ 11
Christoph Behl thanks 👍
8th Jul 2018, 7:39 AM
Shehroz Irfan
Shehroz Irfan - avatar
+ 8
Saurabh Tiwari thank you 👍
23rd Jun 2018, 3:57 PM
Shehroz Irfan
Shehroz Irfan - avatar
+ 8
Mohammad Alshareef i got it . excellent. well explained. thanks 👍💚
24th Jun 2018, 9:13 AM
Shehroz Irfan
Shehroz Irfan - avatar
23rd Jun 2018, 9:47 AM
Shehroz Irfan
Shehroz Irfan - avatar
+ 7
confused ?
23rd Jun 2018, 9:56 AM
Shehroz Irfan
Shehroz Irfan - avatar
+ 7
Seb TheS got it . thanks 👍
23rd Jun 2018, 3:58 PM
Shehroz Irfan
Shehroz Irfan - avatar
+ 5
23rd Jun 2018, 3:35 PM
Saurabh Tiwari
Saurabh Tiwari - avatar
+ 4
shehroz irfan you are welcome.
23rd Jun 2018, 8:22 PM
Saurabh Tiwari
Saurabh Tiwari - avatar
+ 1
I don't study C++, but I know very good what are functions in Python. Functions are type of objects, that return a value depending on their arguments. Functions are called as function name followed by a parenthesis pair having comma separated values called arguments. In function definition the values are called parameters rather than arguments, parameters can't be used outside the function definition.
23rd Jun 2018, 3:51 PM
Seb TheS
Seb TheS - avatar
+ 1
much more simple you can repeat functions in main. reduces code!
8th Jul 2018, 12:39 AM
Christoph Behl
Christoph Behl - avatar
+ 1
Thanks
25th Dec 2018, 12:16 PM
Anjan Sharma
Anjan Sharma - avatar
0
Functions are central to C programming and are used to accomplish a program solution as a series of subtasks.
1st Aug 2020, 1:09 PM
Abhishek_singh
Abhishek_singh - avatar