I want to write a function that creates a "Vector" (template), stores a couple of values in it, then returns that vector. I'm defining the function below "main" and so am using the prototype:
Vector<double> VectorMouseClick;
Is this the correct prototype?
After "main" I'm defining the function and am trying to do it this way but am not sure if it's the correct way to do it:
Vector<double> VectorMouseClick()
{
Vector<double> vector();
...some code manipulating values and storing them in "vector"...
return vector;
}
If a function is returning a class I specify (aka Vector), how do I write the prototype? Since it's a template class do I do it like above: Vector VectorMouseClick; or is it: Vector VectorMouseClick; (as like the other prototypes (int ReturnValues, void SomeFunct, etc)
When exactly can I use "void" on a prototype? Is this only for functions that don't "return" a value? I've looked through the answers on here but as I'm new to C++ some of them are a little hard to understand. Any help would be greatly appreciated!