我很困惑何时使用宏或枚举.两者都可以用作常量,但它们之间有什么区别,哪一个有什么优势?它是否与编译器级别有关?
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.
我们可以sizeof在#if宏中使用运算符吗?如果有,怎么样?如果没有,为什么?
sizeof运算符是否在预处理程序#if指令中工作?
昨天在采访中有一个问题要求我main回复struct?我不知道任何人都可以告诉我是否可能,如果是,为什么?
在下面的例子中,当我定义char数组未初始化并想要找到长度时,它是未定义的行为.
#include<stdio.h>
int main()
{
char a[250];
printf("length=%d\n",strlen(a));
}
Run Code Online (Sandbox Code Playgroud)
我得到了"0".我不知道怎么样?解释一下.