次のプログラムでは、行 5 でエラーが発生しますが、行 11 ではエラーが発生しませんが、どちらも同じことを行っています。つまり、文字列を 0 で初期化していますか? 私はそれがコンパイラエラーを与えることをよく知っています.5行目でエラーが発生した場合、なぜ11行目でエラーが発生しないのでしょうか?
#include<stdio.h>
int main()
{
char name[20]=0; //This should also run if line 11 runs without an error where string is being initialized by zero.
struct node
{
char name[20];
int no;
};
struct node a={0};
}