【发布时间】:2020-02-23 08:33:29
【问题描述】:
struct Vertex
{
float Position[3];
float Color[4];
float TextCoords[2];
float TexId;
};
static std::array<Vertex, 4> CreateQuad(float x, float y) {
Vertex v;
v.Position = { 0.0f,0.0f,0.0f };
}
这给了我一个错误,即 v 必须可修改的 ivalue。以及太多的初始化值。
【问题讨论】:
-
Vertex v{};将实现目标
标签: c++ arrays struct compiler-errors syntax-error