如何在程序C ++中解决此错误:错误:在'{'标记之前不允许使用括号括起的初始值设定项 [英] How to solve this error in a program C++ : error: a brace-enclosed initializer is not allowed here before '{' token
问题描述
如何在程序c ++中解决此错误:错误:在'{'令牌之前不允许使用括号封闭的初始化程序 - 电气和电子工程
[垃圾邮件已删除]
请查看链接以获取说明
我尝试了什么:
我尝试在vivado HLS中模拟我的代码c ++!
我需要帮助来解决这个问题!
how to solve this error in a program c++ : error: a brace-enclosed initializer is not allowed here before '{' token - Electrical and Electronics Engineering
[SPAM LINK REMOVED]
Please check the link for description
What I have tried:
I try to simulate my code c++ in vivado HLS !
I need help to solve this problem !
推荐答案
数组的初始化必须与声明匹配。正确完成上面的代码行。
Your initialization of the array must match the declaration. A code line above it correctly done.
double nr_class[1][1]={{3}};
这应该正确地初始化你的二维数组。
我不仅使用const关键字而且使用大写字母表示常量,还使用说话名称。当代码在几个月或几年内更改时,这使维护更容易。
This should correctly initialize your 2 dimensional array.
I use not only the const keyword but capital letters for constants, but also speaking names. This makes maintenance easier, when the code is changed in some months or years.
这篇关于如何在程序C ++中解决此错误:错误:在'{'标记之前不允许使用括号括起的初始值设定项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!