bio*_*osr 1 c++ arrays string typedef
#include <iostream>
#include <array>
#include <string>
using namespace std;
typedef array<string,3> TString;
int main(){
TString str;
str = {"Hi","Example", "Error"};
cout << str[0] <<endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我得到的原始错误代码:
pruebastr.cpp:10:8:错误:期望的表达式str = {"Hi","Example","Error"}; 生成^ 1错误.
我是以错误的方式定义数组还是错误地初始化它?
| 归档时间: |
|
| 查看次数: |
61 次 |
| 最近记录: |