小编Var*_*ani的帖子

是什么让C,宏或枚举更好?

我很困惑何时使用宏或枚举.两者都可以用作常量,但它们之间有什么区别,哪一个有什么优势?它是否与编译器级别有关?

c macros enums

34
推荐指数
5
解决办法
2万
查看次数

C甚至有"通过引用传递"吗?

I heard that in "c" that there are we can pass the arguments via "call by value" or "call by reference". But in one book it's mentioned that there are we can pass the arguments via both way but there is no "pass by reference" but I actually pass the mostly arguments by "pass by reference".

So why it is mentioned "does C even have "pass by reference"?

A detailed description will be greatly appreciated.

c pointers

4
推荐指数
2
解决办法
4684
查看次数

sizeof运算符是否在预处理器#if指令中工作?

我们可以sizeof#if宏中使用运算符吗?如果有,怎么样?如果没有,为什么?

sizeof运算符是否在预处理程序#if指令中工作?

c sizeof

4
推荐指数
3
解决办法
6945
查看次数

main()可以返回结构吗?

昨天在采访中有一个问题要求我main回复struct?我不知道任何人都可以告诉我是否可能,如果是,为什么?

c struct program-entry-point

2
推荐指数
2
解决办法
796
查看次数

可以在 C 中的标识符中的任何地方使用下划线吗?

我有一个简单的问题:我可以在标识符的任何地方使用下划线吗?

如果是,请举例,如果不是,请说明原因。

c

2
推荐指数
3
解决办法
3926
查看次数

是否有必要初始化char数组以获得准确的长度?

在下面的例子中,当我定义char数组未初始化并想要找到长度时,它是未定义的行为.

#include<stdio.h>
 int main()
{
char a[250];
printf("length=%d\n",strlen(a));
}
Run Code Online (Sandbox Code Playgroud)

我得到了"0".我不知道怎么样?解释一下.

c string

0
推荐指数
1
解决办法
1008
查看次数

标签 统计

c ×6

enums ×1

macros ×1

pointers ×1

program-entry-point ×1

sizeof ×1

string ×1

struct ×1