求助 strlen 出错 No source available for "strlen() at 0xb7b793d0"
系统平台:debian 6.0
开发平台 : eclipse Helios Service Release 2 + CDT
gcc (Debian 4.4.5- 4.4.5
代码如下:
- #include <iostream>
- #include "string.h"
- #include <fstream>
- using namespace std;
- int main() {
- ifstream f1;
- f1.open("2.txt", ios::in);
- int i = 1;
- while (i == 1) {
- char pos[200] = "";
- char val[200] = "";
- //f1.getline(pos, '\r\n');
- f1 >> pos;//读出索引编号
- if (pos[0] - 48 == 2) //从文本里读出来的pos[0] 读到最后一行的时候为2 ,2的ASCII码是50
- break;
- i = pos[0] - 48; //1的ASCII码是49 49 - 48 = 1 循环不停的执行
- f1 >> val;//读出数据
- int length = 0;
- length = strlen(pos);
- for (int j = 1; j < length; j++) {
- if (pos[j] == 49) {
- cout << "shi 1" << endl;
- }
- }
- }
- f1.close();
- }
复制代码2.txt内容为:
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 111
- 112
- 113
- 1111
- 22222
复制代码
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
帮顶
调试的时候strlen出错。
No source available for "strlen() at 0x********