1、如果函数没有必要返回值就用void,如果函数需要返回值就用 int,float,double 等类,譬如说void test(){ printf("test");}就没有必要返回值了, 但如果int test(){ return 99;}void main(){ int n; n=test();}就需要返回值了问题是你要做些什么而决定要用什么类的函数。
2、而不是可不可以。
1、如果函数没有必要返回值就用void,如果函数需要返回值就用 int,float,double 等类,譬如说void test(){ printf("test");}就没有必要返回值了, 但如果int test(){ return 99;}void main(){ int n; n=test();}就需要返回值了问题是你要做些什么而决定要用什么类的函数。
2、而不是可不可以。
上一篇:閄怎么读 閄的拼音是什么
下一篇:力气大的成语及解析