bool和void有什么区别
- 经验
- 关注:1.2W次
bool类型返回值只有true或是false而void的返回值只是执行这段函数,没有任何的返回值。
eg:boola(){if(1=1)returnture;elsereturnfalse}必须有return
eg:voidb(){if(1=1)printf("执行语句")elseprintf("执行了else语句")}没有return只是执行printf语句而已。
- 文章版权属于文章作者所有,转载请注明 https://zhizhiguan.com/jingyan/o6202l.html