正在加载图片...
The c Programming language Chapter8 Functions s8.3 The Return Statement o Format: return( expression ) O return expression O return Function The return statement is the mechanism for returning a value from the called function to the calling function ☆Spec >Th as function without returned value ts in a function >If void swap(int x, int y is passed back toi int temp g brace)is en temp-=X sary to the y=temp >Be valueThe C Programming Language Chapter 8 Functions §8.3 The Return Statement ❖ Format: return( expression ); or return expression ; or return ; ❖ Function: The return statement is the mechanism for returning a value from the called function to the calling function. ❖ Specifications: ➢There can be zero or more return statements in a function; ➢If there is no return statement,then control is passed back to the calling environment when the closing brace } is encountered; ➢The expression will be converted, if necessary, to the return type of the function . ➢Be notice to the functions needn’t returned value. as function without returned value void swap(int x,int y ) { int temp; temp=x; x=y; y=temp; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有