正在加载图片...
The c Programming language Chapter8 Functions Returne-type by the function If omitted, then it is int by default. If no value is returned, then the type is void Valid identifier Newer style:type function-name( parameter declaration list) declarations statements Function body as function without parameters printstar() print(“******n”) O printstar(void { printf(***n”);}The C Programming Language Chapter 8 Functions §8.2 Function Definition type function-name( parameter declaration list ) { declarations statements } Newer style: as function with parameters int max( int x , int y ) { int z; z=x>y?x:y; return(z); } as function with parameters int max(int x, y) { int z; z=x>y?x:y; return(z); } as do-nothing function dummy( ) { } is useful as a place holder during program development as function without parameters printstar( ) { printf(“**********\n”); } or printstar(void ) { printf(“**********\n”); } Function body Valid identifier Returne-type by the function If omitted,then it is int by default. If no value is returned, then the type is void
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有