#include<iostream>
#include<string>
using namespace std;
int main(void) {
struct STRCT {
int num;
string str1,
arrStr1[],
str2,
arrStr2[];
};
int a;
string b[2],
c[3],
d,
e;
a = 10;
b[0] = "hello";
b[1] = "world";
c[0] = "stack";
c[1] = "over";
c[2] = "flow";
d = "random";
e = "text";
//how do i intialize the arrays (arrStr1[] and arrStr2[]) in aStruct along with the rest of items?
//is it like this?
//i want aStruct[] to be an array and i want its size to be declared from the start to later be filled with vals
STRCT aStruct[2];
//then later in the program i want to assign aStruct[] vals
aStruct[0] = {a, //int
d, //string
{b}, //string[]
e, //string
{c}}; //string[]
}
所以基本上我想制作一个内部包含数组的结构数组,然后获取正确的 val,然后将正确的 val 分配给结构数组内的数组。非常感谢您的帮助