C语言错误之:[Error] expected ':', ',', ';', '}' or '__attribute__' before '=' token

今天在编程的时候,犯了一些低级的错误,有很多低级的错误!不过今天要写出的这个错误是:[Error] expected ':', ',', ';', '}' or '__attribute__' before '=' token,代码如下:

typedef struct Books{
	char titile = "C语言高级编程";
	char author = "Runoobs"
	char ject = "编程语言";
	int book_id = "123";
}Book;

运行时就会出现如下错误提示

然后在网上查看资料的时候,才发现,原来结构体声明时是不能够初始化。 

发布了122 篇原创文章 · 获赞 36 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/qqj3066574300/article/details/103140884