请帮助查找错误
Please help in finding the error
我在NetBeans上做了一个程序,但有一个错误,我不知道该怎么做。如果你们中有人能帮助我,那就太好了。
以下是我需要回答的问题:
尽可能干净地编写一个C++程序:
1) 声明数组classique1t1字符串("到C"),包含一周中的日期名称(星期一、星期二、…)
2) 从t1到t2建立一个新的经典表,其中还包含名称一周中的几天,但按字母顺序升序排列
3) 以每行一天名称的速率显示表t1和t2 的内容
4) 删除表t2
5) 结束
在这个链接中:http://www.codeshare.io/wGWlQ就是我做的节目。
"尽可能干净的C++程序":
std::array<std::string, 7> t1 = { // Array of strings t1
"Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday", "Sunday"
};
auto t2 = t1; // Create t2
std::sort(std::begin(t2), std::end(t2)); // to sort the right order
std::cout << "t1 content: " << std::endl; // Display contents
for (const auto& x : t1) {
std::cout << x << std::endl;
}
std::cout << "t2 content: " << std::endl; // Display contents
for (const auto& x : t2) {
std::cout << x << std::endl;
}
// Remove the table t2
// Ends
如果你真的必须使用c字符串,你可以把数组的类型改为const char*
?
相关文章:
- 查找显示链表时出现的错误
- enable_if继承的成员函数的名称查找错误
- 用于查找数组中最大元素的出现次数的代码,给出分段错误
- 使用 c++ 查找 lapindromes 时运行时错误"SIGCONT"
- 旧C++代码中的目录查找导致 OS X Catalina 10.15 中的目录错误
- 尝试查找两组点的交集,错误"No viable overloaded '=' "
- 在尝试使用递归查找集合子集的总数时,我遇到了分割错误
- 查找素数:错误:控件到达非void函数的末尾
- DEV C++ 第 69 行 [错误] ISO "for" 范围更改了"i"的名称查找 [-允许]
- 与Qt交叉编译到Raspberry Pi 3B+通讯录(协议缓冲区)-错误符号查找错误
- 如何修复错误:使用向量查找最小值和最大值进行合并排序
- 需要一些帮助来查找我的程序中的逻辑错误
- OpenCV CV 查找单应断言错误计数器 = > 4
- 我的代码似乎在查找最大数字时存在语法错误
- 在编写代码以查找数组中的对数时获取分段错误
- 符号查找错误未定义的符号:curl_mime_init
- 从模板实例化/类型推断中查找错误消息的实际来源
- 质数查找器运行时错误
- 我在代码中收到一个运行时错误,该错误如何通过修改最多一个元素来查找数组是否可以变得不减少
- 分段错误 - 查找列表的根