A macro is a snippet of code that will be pasted wherever you write "cal". A macro seems to return something when what it pastes is a single expression. You can't do it in this case, and even if you did, why would you? If you want to loose the overhead of calling the function, make it inline.
#define cal(v, c) (c = 0, for(int i = 0; i < v.size(); i++) c += v[i])
and work but i dont know i have some problem with macro do you know a beast and complete reference about macro in c++?