以下のコードが機能するのはなぜですか? それはコンパイル エラー (または少なくとも実行時エラー) でしょうか?
#include <stdio.h>
int main(int argc, char** argv){
        float *buf = "happy holiday";        // notice the float
        printf("content of buf = %s\n",buf); //its working
        return 0;
}
私はそれをコンパイルし、ちょうど警告を得ました:
~/Desktop/cTest>gcc -o run run.c
run.c: In function `main':
run.c:4: warning: initialization from incompatible pointer type