可能的重复:
如何在没有循环的情况下将数组初始化为C语言?
如何在C中初始化数组
如何在不使用for或任何其他循环的情况下将已知大小的数组归零?
例如:
arr[20] = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;
Run Code Online (Sandbox Code Playgroud)
这是漫长的道路......我需要它的简短方法.
i = i + j ;
j = i - j ;
i = i - j ;
Run Code Online (Sandbox Code Playgroud)
上面的代码是做什么的?有人可以用其他代码编写相同的操作吗?
日Thnx.
int *(*(*P)[2][2])(int,int);
Run Code Online (Sandbox Code Playgroud)
P是指向具有2个int类型参数的函数的2x2指针数组的指针,它返回一个int类型指针.它是否正确?
我有这个功能:
/*This func runs *.c1 file, and replace every include file with its content
It will save those changes to *.c2 file*/
void includes_extractor(FILE *c1_fp, char *c1_file_name ,int c1_file_str_len )
{
int i=0;
FILE *c2_fp , *header_fp;
char ch, *c2_file_name,header_name[80]; /* we can assume line length 80 chars MAX*/
char inc_name[]="include";
char inc_chk[INCLUDE_LEN+1]; /*INCLUDE_LEN is defined | +1 for null*/
/* making the c2 file name */
c2_file_name=(char *) malloc ((c1_file_str_len)*sizeof(char));
if (c2_file_name == NULL)
{
printf("Out of memory !\n"); …Run Code Online (Sandbox Code Playgroud) 我想创建一个名为increaseValue的方法,它的签名如下:
public Size increaseValue(Size s)
Run Code Online (Sandbox Code Playgroud)
我还有以下声明:
protected enum Size {XS, S, M, L, XL}
Run Code Online (Sandbox Code Playgroud)
我需要知道,如何在不使用Switch-Case语句的情况下使方法返回正确的值(即输入为L时的XL ......等)?
谢谢 !