您的位置:首页 > 编程语言 > C语言/C++

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';
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: