小弟是菜鸟爱钻牛角尖求大虾们解决!
在c语言中 函数的末尾加上 return 是干什么用的;为什么都用 return 0;return -100 ,1000,行不行 求解答
比如两个数相加,用return返回结果

int Plus(int a, int b) { return a+b; } int main() { printf("%d", Plus(10, 20)); return 0; }
其中int Plus(....)的第一个int是指返回值的类型。
有的函数没有返回值,比如:

void ShowMessage() { printf("Hello, World"); }
如果没返回值的话,就在函数前面加一个vode