New to C++

So I'm studying for C++ and I need help with functions.

I do not understand the general idea of it. What do they do, if it can be said in the simplest way possible, and how do I know where to place them?

Do I place them before INT MAIN, or after int main? Like how does it work.

And when do I declare a function as void. "void graphcharts ()" < example. When do I know whether to do void or like, int, or like bool etc.

Im so confused
Try http://www.cplusplus.com/doc/tutorial/functions/.

If new to C++ then its not a bad idea to study the cplusplus.com Tutorial. Its full of nice and simple examples.
So a function is a group of statements that you name, so that you can call it later at some point. Like for instance:

return_type function_name(parameter list)
{
body of function
}

http://www.cplusplus.com/doc/tutorial/functions/
This link is a great reference to functions and how to declare them and use them.

Placement of these functions is dependent on the specific job that it is intended to do. Typically you declare it before INT MAIN, they after INT MAIN is written you can write the work part of the function a good example of that is here at this link.
http://www.tutorialspoint.com/cplusplus/cpp_functions.htm
Topic archived. No new replies allowed.