I am wondering is it okay to return a vector in main()
? For example,
aSpecialVectorType main()
{
aSpecialVectorType xxx(vector::zero);
// do something here;
return xxx;
}
Do I need to forward declare "class aSpecialVectorType;
" before main()
?
And btw, is it legal to use another name other than "main
" in c++?
Thanks
Edit1:
If not, what is the best way that it can output a vector?
My friend ask me to give him a blackbox that can serve as "vector in and vector out", he will use his matlab code to call my code. That's why I am asking. I know how to vector in, but not sure if there is an easy way to output a vector.
Thanks
Edit2:
I am surprised why C++ has such an standard, any explanation? :)