我为什么要来
lvalue required as left operand of assignment
Run Code Online (Sandbox Code Playgroud)
用单个字符串比较?我该如何解决这个问题C?
if (strcmp("hello", "hello") = 0)
Run Code Online (Sandbox Code Playgroud)
谢谢!
在C中,最好的方法是查看一个数字是否可以被另一个数除尽?我用这个:
if (!(a % x)) {
// this will be executed if a is divisible by x
}
Run Code Online (Sandbox Code Playgroud)
反正哪个更快?我知道这样做,即130%13将导致每10次做130/13.因此,只需要一个循环就有10个循环(我只想知道130是否可以被13整除).
谢谢!
当我给它编号为4293974227(或更高)时,为什么这样的代码应该提供如此高的结果?
int main (int argc, char *argv[])
{
unsigned long long int i;
unsigned long long int z = atoi(argv[1]);
unsigned long long int tmp1 = z;
unsigned long long int *numbers = malloc (sizeof (unsigned long long int) * 1000);
for (i=0; tmp1<=tmp1+1000; i++, tmp1++) {
numbers[i] = tmp1;
printf("\n%llu - %llu", numbers[i], tmp1);
}
}
Run Code Online (Sandbox Code Playgroud)
结果应以提供的数字开头,但是如下所示:
18446744073708558547 - 18446744073708558547
18446744073708558548 - 18446744073708558548
18446744073708558549 - 18446744073708558549
18446744073708558550 - 18446744073708558550
18446744073708558551 - 18446744073708558551
Run Code Online (Sandbox Code Playgroud)
ECC ...
什么是废话?
谢谢!
在C中,为什么呢
strtoul(argv[1])
只是不起作用?看起来需要更多的参数,但我不能阻止这个数字有多长.
谢谢!
ps(argv [1]已正确设置).