string' does not name a type 及命名空间

在做c++ primer 中习题时,发现string' does not name a type;


#include
#include
#include
string sa[10];
int ia[10];


using namespace std;

int main(int argc, char *argv[])
{
    string sa2[10];
    int ia2[10];
    for (int i=0; i!=0
    cout <<*sa<    
    system("PAUSE");
    return EXIT_SUCCESS;
}




出现string' does not name a type。

需要将定义放在using namespace std 后。

你可能感兴趣的:(VC2012)