Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我尝试在二维数组中添加结构时
cin>>array[1][items.stoka_ime];
在错误列表中写下:
IntelliSense: no operator "[]" matches these operands
从您的问题中不清楚您的实际问题是什么。所以我只是展示了一个数组和结构组合使用的示例。
对于结构数组
struct abc { int i; int j; } abc object[10]; cin>>object[0].i>>object[0].j;
结构中的数组
struct abc { int i[10]; } abc object; cin>>object.i[0];
推入队列结构数组:
queue.push(array[i]);