C++合约ID转换为简明合约代码
2013-07-20 13:28
218 查看
#include<iostream>
#include "common.h"
#include<string>
#include <ctype.h>
#include<boost/date_time.hpp>
#include "Dictionary.h"
using namespace std;
using namespace boost::gregorian;
using namespace boost;
void GetShortInstrument(SWInstrumentIDDataType InstrumentID, SWShortInstrumentIDDataType szShortInstrumentID);
void main()
{
SWShortInstrumentIDDataType szRes;
SWInstrumentIDDataType myInstrumentID;
strcpy(myInstrumentID, "IF1305");
GetShortInstrument(myInstrumentID, szRes);
cout << szRes << endl;
int wait;
cin >> wait;
}
void GetShortInstrument(SWInstrumentIDDataType InstrumentID, SWShortInstrumentIDDataType szShortInstrumentID)
{
int i = 0;
while (InstrumentID[i] != '\0' && !isdigit(InstrumentID[i]) && i < 5)
{
szShortInstrumentID[i] = InstrumentID[i];
++i;
}
szShortInstrumentID[i] = '\0';
}
#include "common.h"
#include<string>
#include <ctype.h>
#include<boost/date_time.hpp>
#include "Dictionary.h"
using namespace std;
using namespace boost::gregorian;
using namespace boost;
void GetShortInstrument(SWInstrumentIDDataType InstrumentID, SWShortInstrumentIDDataType szShortInstrumentID);
void main()
{
SWShortInstrumentIDDataType szRes;
SWInstrumentIDDataType myInstrumentID;
strcpy(myInstrumentID, "IF1305");
GetShortInstrument(myInstrumentID, szRes);
cout << szRes << endl;
int wait;
cin >> wait;
}
void GetShortInstrument(SWInstrumentIDDataType InstrumentID, SWShortInstrumentIDDataType szShortInstrumentID)
{
int i = 0;
while (InstrumentID[i] != '\0' && !isdigit(InstrumentID[i]) && i < 5)
{
szShortInstrumentID[i] = InstrumentID[i];
++i;
}
szShortInstrumentID[i] = '\0';
}
相关文章推荐
- ROS python 代码转换到 C++
- 简明教程 C++代码折叠
- QML和C++代码之间互相调用及参数之间的转换
- 整数转换成字符型的两种方法c++代码实例及运行结果
- c++ 数据格式转换代码
- 整数转换成字符型的两种方法c++代码实例及运行结果
- [C++][代码共享]将UTF-8的std::string转换成std::wstring
- (转)不同框架下的C++字符串代码转换
- Android NDK的C/C++代码中利用JNI回调实现字符编码转换的试验(中文UTF8与GBK)
- ios oc 代码 转换为 c++ 描述代码编译过程
- RGB空间与HSV空间的相互转换(C++实现,修正网上大多数的代码错误)
- YUV 格式与 RGB 格式的相互转换公式及C++ 代码
- 整数转换成字符型的两种方法c++代码实例及运行结果
- android:查找布局文件中有id属性的内容,并生成java转换代码
- 类的初步知识(C++中直角坐标和极坐标之间的转换代码)
- C++中string与int的相互转换实现代码
- 二进制值和十六进制字符串相互转换的C++代码
- 二进制值和十六进制字符串相互转换的C++代码
- 八进制与十进制相互转换c++代码实例及运行结果
- C++时间戳转换成日期时间的步骤和示例代码