我确信以下代码不应该编译.但是,在g ++中,它确实可以编译!请参阅http://codepad.org/MR7Dsvlz编译.
代码:
#include <iostream>
using namespace std;
int main() {
int x = 32 ;
// note: if x is, instead, a const int, the code still compiles,
// but the output is "32".
const int * ptr1 = & x ;
*((int *)ptr1) = 64 ; // questionable cast
cout << x ; // result: "64"
}
Run Code Online (Sandbox Code Playgroud)
编译时g ++是错误的吗?
PulseAudio文档中似乎缺少一个明确的解释,我找不到任何简单的例子.
我使用的是Ubuntu(Amazon EC2),当我输入时cd,会发生这种情况:
$ cd
hi
hi
hi
hi
hi
hi
hi
hi
hi
$
Run Code Online (Sandbox Code Playgroud)
我之前做过:做一个功能: : () { echo hi; }
这发生在顶级shell中$SHLVL=1,但不在任何子shell中(键入bash然后尝试重现它不起作用).
有谁知道为什么会这样?