c语言多个形参,C中子函数最多有几个形参

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

C89 31个,C99 127个。

ANSI C89

2.2.4.1 Translation limits

The implementation shall be able to translate and execute at least one program that contains at least one instance of every one of the following limits:

* 15 nesting levels of c0mp0und statements, iteration control structures, and selection control structures

* 8 nesting levels of conditional inclusion

* 12 pointer, array, and function declarators (in any combinations) modifying an arithmetic, a structure, a union, or an incomplete type in a declaration

* 31 declarators nested by parentheses within a full declarator

* 32 expressions nested by parentheses within a full expression

* 31 significant initial characters in an internal identifier or a macro name

* 6 significant initial characters in an external identifier

* 511 external identifiers in one translation unit

* 127 identifiers with block scope declared in one block

* 1024 macro identifiers simultaneously defined in one translation unit

* 31 parameters in one function definition

* 31 arguments in one function call

* 31 parameters in one macro definition

* 31 arguments in one macro invocation

* 509 characters in a logical source line

* 509 characters in a character string literal or wide string literal (after concatenation)

* 32767 bytes in an object (in a hosted environment only)

* 8 nesting levels for #include'd files

* 257 case labels for a switch statement (excluding those for any

nested switch statements)

* 127 members in a single structure or union

* 127 enumeration constants in a single enumeration

* 15 levels of nested structure or union definitions in a single struct-declaration-list

ISO C99

5.2.4.1 Translation limits

1 The implementation shall be able to translate and execute at least one program that

contains at least one instance of every one of the following limits:13)

— 127 nesting levels of blocks

— 63 nesting levels of conditional inclusion

— 12 pointer, array, and function declarators (in any combinations) modifying an arithmetic, structure, union, or incomplete type in a declaration

— 63 nesting levels of parenthesized declarators within a full declarator

— 63 nesting levels of parenthesized expressions within a full expression

— 63 significant initial characters in an internal identifier or a macro name (each universal character name or extended source character is considered a single character)

— 31 significant initial characters in an external identifier (each universal character name specifying a short identifier of 0000FFFF or less is considered 6 characters, each universal character name specifying a short identifier of 00010000 or more is considered 10 characters, and each extended source character is considered the same number of characters as the corresponding universal character name, if any)

— 4095 external identifiers in one translation unit

— 511 identifiers with block scope declared in one block

— 4095 macro identifiers simultaneously defined in one preprocessing translation unit

— 127 parameters in one function definition

— 127 arguments in one function call

— 127 parameters in one macro definition

— 127 arguments in one macro invocation

— 4095 characters in a logical source line

— 4095 characters in a character string literal or wide string literal (after concatenation)

— 65535 bytes in an object (in a hosted environment only)

— 15 nesting levels for #included files

— 1023 case labels for a switch statement (excluding those for any nested switch statements)

— 1023 members in a single structure or union

— 1023 enumeration constants in a single enumeration

— 63 lev els of nested structure or union definitions in a single struct declaration-list

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
函数C语言中的一个重要概念,它可以有形参和返回值。当函数形参时,它可以接受外部传入的数据,这些数据称为实参。函数可以使用这些实参来执行特定的任务,并且还可以修改实参的值。而函数的返回值是函数执行完后返回给调用它的代码的值。返回值可以是任何C语言支持的数据类型,例如char、int、double等。 在C语言中,函数形参和返回值是由函数的声明和定义来确定的。函数的声明指明了函数的名称、形参的类型和返回值的类型。函数的定义则是函数的实际实现,包括了函数体中的具体代码。 下面是一些示例代码来说明函数形参和返回值的使用: 1. 示例代码:传递数字及字符 ```c #include <stdio.h> void printNumAndChar(int num, char ch) { printf("Number: %d\n", num); printf("Character: %c\n", ch); } int main() { int num = 10; char ch = 'A'; printNumAndChar(num, ch); return 0; } ``` 2. 示例代码:返回一个char类型的值 ```c #include <stdio.h> char getChar() { return 'A'; } int main() { char ch = getChar(); printf("Character: %c\n", ch); return 0; } ``` 3. 示例代码:返回一个int类型的值 ```c #include <stdio.h> int add(int a, int b) { return a + b; } int main() { int result = add(2, 3); printf("Result: %d\n", result); return 0; } ``` 4. 示例代码:返回一个double类型的值 ```c #include <stdio.h> double divide(double a, double b) { return a / b; } int main() { double result = divide(10.0, 2.5); printf("Result: %f\n", result); return 0; } ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值