string不是std的成员????

深渊丶唤雨 2017-03-31 02:44:17
// NodewebFO.cpp : 定义控制台应用程序的入口点。
//

#include<iostream>
#include<string>


#include "stdafx.h"
//#include "DLLprocess.h"

using namespace std;

class OutCal
{
public:
OutCal(int L,int C,int R,std::string f);
~OutCal();
int GL();
int GC();
int GR();
std::string GF();
std::string Gfilenamex();
std::string Gfilenamee();

private:
int Level;
int Col;
int Row;
std::string from;
std::string r;
std::string c;
std::string l;
};

OutCal::OutCal(int L, int C, int R, std::string f)
{
Level = L;
Col = C;
Row = R;
from = f;



char strl[3];
sprintf(strl, "%d", Level);
int lLength = strlen(strl);
l = strl;
if (lLength < 2) {
for (int i = 0; i < 2 - lLength; i++) {
l = "0" + l;
}
}
l = "L" + l;
const char* Charl = l.c_str();

int rGroup = 128 * (Row / 128);
char strr[5];
sprintf(strr, "%x", rGroup);
int rLength = strlen(strr);
r = strr;
if (rLength < 4) {
for (int i = 0; i < 4 - rLength; i++) {
r = "0" + r;
}
}
r = "R" + r;

int cGroup = 128 * (Col / 128);
char strc[5];
sprintf(strc, "%x", cGroup);
c = strc;
int cLength = strlen(strc);
if (cLength < 4) {
for (int i = 0; i < 4 - cLength; i++) {
c = "0" + c;
}
}
c = "C" + c;
}

OutCal::~OutCal()
{
}

int OutCal::GL()
{
return Level;
}

int OutCal::GC()
{
return Col;
}

int OutCal::GR()
{
return Row;
}

std::string OutCal::GF()
{
return from;
}

std::string OutCal::Gfilenamex()
{
return from + "/" + l + "/" + r + c + ".bundlx";
}

std::string OutCal::Gfilenamee()
{
return from + "/" + l + "/" + r + c + ".bundle";
}

int main()
{
OutCal OC(2, 6863, 1374, "_alllayers");
cout << OC.Gfilenamee() << endl;
cout << OC.Gfilenamex() << endl;
return 0;
}
...全文
382 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
深渊丶唤雨 2017-03-31
  • 打赏
  • 举报
回复
发现VS2015坑爹地强行加了一个预编译的头文件 在这个CPP文件右键查看属性,C++里面有一个不是用预编译头就可以了
深渊丶唤雨 2017-03-31
  • 打赏
  • 举报
回复
编译器是VS2015 关键在于没有一处有红色的波浪线的

64,685

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧