【发布时间】:2012-12-23 23:17:31
【问题描述】:
我正在尝试制作一个二维向量,其中 0 和 1 坐标都是复数,定义向量似乎工作正常,但是当我尝试访问它时,我收到一个错误带有大量乱码的新标签,但其中某处显示矢量下标无效。 (删节的)代码是
#include <iostream>
#include <vector>
#include <complex>
using namespace std;
int main()
{
vector<vector<complex<double>>> rho;
for(int g = 0; g < 4; ++g){
for(int h = 0; h < 4; ++h){
rho.push_back(vector<complex<double>>(2));
rho.at(g).at(h) = 0;
cout << rho.at(g).at(h)<<endl;
}
}
}
任何帮助将不胜感激:) xx
【问题讨论】:
标签: c++ visual-studio-2010 vector complex-numbers subscript