Rajnish Kaushik Posted January 1, 2014 Posted January 1, 2014 Can someone help me on functions in c++
pears Posted January 1, 2014 Posted January 1, 2014 You'll need to be a bit more specific than that 3
Rajnish Kaushik Posted January 2, 2014 Author Posted January 2, 2014 i did not understood anything on functions
pears Posted January 2, 2014 Posted January 2, 2014 What exactly are you having trouble with? Do you have an example?
Rajnish Kaushik Posted January 2, 2014 Author Posted January 2, 2014 How to i use it in programs and why?
pears Posted January 2, 2014 Posted January 2, 2014 http://www.cplusplus.com/doc/tutorial/functions/ 3
Rajnish Kaushik Posted January 2, 2014 Author Posted January 2, 2014 Thats to hard can u have something more simpler please
Rajnish Kaushik Posted January 2, 2014 Author Posted January 2, 2014 need tutorials on Functions in c++
Lightmeow Posted January 2, 2014 Posted January 2, 2014 Heres a good link: http://www.cplusplus.com/doc/tutorial/functions/ 1
Strange Posted January 2, 2014 Posted January 2, 2014 A function is a piece of code with a name. You can provide it with values and it can return a value when it completes. It is a type of subroutine. http://www.cs.utah.edu/~germain/PPS/Topics/functions.html http://en.wikipedia.org/wiki/Subroutine
Lightmeow Posted January 4, 2014 Posted January 4, 2014 What are you asking, I know java, so it might not be the same for c++, but a function could be 8+4, if maybe you are trying to make a math application, or are you asking about something defining a function?
Rajnish Kaushik Posted January 4, 2014 Author Posted January 4, 2014 simple school level functions in c++
Rajnish Kaushik Posted January 4, 2014 Author Posted January 4, 2014 I'm going to have to do some research in it. thanks
Binary Tree Posted April 26, 2018 Posted April 26, 2018 (edited) A function is a way to encapsulate a block of code. Say you have to do some computation multiple times. Instead of repeating the code that does the computation multiple times, you enclose that code in a function, and call the function every time you need to do the computation. A big advantage of this is that if you need to modify the computation code, you only need to do that in one place. Another important use for functions is to decompose other long functions. Say you have a function where you first do A, then B, and then C. It is a good idea to separate the code that does A into a function, the code that does B into another function, and the code that does C into yet another function. Then you have your function just call those three functions. This makes it much easier to read and maintain you code. Edited April 26, 2018 by Binary Tree
thuvienkhoahoc Posted November 29, 2019 Posted November 29, 2019 If you find it difficult to use a function in a C ++ language that you can describe ???
petrushka.googol Posted December 19, 2019 Posted December 19, 2019 Functions return a value but it can be an array... Recursive functions can call the same function again eg. Fibonacci
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now