【发布时间】:2011-01-28 04:05:44
【问题描述】:
#include<iostream>
#include<cmath>
#include<iomanip>
#include<string>
using namespace std;
int main()
{
string word;
int j = 0;
cin >> word;
while(word[j]){
cout << "idk";
j++;
}
cout << "nope";
system("pause");
return 0;
}
这只是一个小试验程序来测试这个循环。我正在处理的程序是关于元音和从用户确定的序列中打印元音。在用户输入之前,该字符串才被定义。谢谢你们提前帮助。
【问题讨论】:
标签: c++ string loops null undefined