国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
從文華財(cái)經(jīng)Mytrader2009中讀取數(shù)據(jù) ? COS論壇 | 統(tǒng)計(jì)之都

接abel的帖子,,,現(xiàn)日數(shù)據(jù)的破解如下:

#include <iostream>
#include <fstream>

using namespace std;

struct wenhua
{
int date;
float open;
float close;
float high;
float low;
float vol;
float openinterest;
float settleprice;
//float other;
//char c1[6];
};

void error(string errmsg){

cerr<<errmsg<<endl;
cin.get();
exit(1);
}

int main(int argc,char * argv[]){

if(3 != argc )
error("argument must be original dat and output csv");

int c=0;
////////////// try char offset !!! when c==5 success!!!!!/////////////
// while(c<100){
// c++;

ifstream in(argv[1],ios::binary);
if(!in) error("input dat error!");

ofstream out(argv[2],ios::out);
if(!out) error("output csv error!");

wenhua mywh;

int count = 0;

while(!in.eof() ){
in.read((char *)&mywh,sizeof(mywh));
time_t rawtime = mywh.date ;
struct tm * ptm = localtime(&rawtime);

char _date[20];
char _time[20];
memset(&_date,0,sizeof(_date));
memset(&_time,0,sizeof(_time));
sprintf(_date,"%d-%d-%d", ptm->tm_year+1900,ptm->tm_mon + 1,ptm->tm_mday);
sprintf(_time,"%d:%d:%d", ptm->tm_hour,ptm->tm_min,ptm->tm_sec);

cout<<_date<<' '<<_time<<' '<<mywh.date<<' '<<mywh.open<<' '<<mywh.high<<' '
<<mywh.low<<' '<<mywh.close<<' '<<mywh.vol<<' '
<<mywh.openinterest<<' '<<mywh.settleprice<<' '
<<endl;
out<<_date<<','<<mywh.close<<endl;

count++;

// cout<<"offset:"<<c<<endl;
/////////////////set c=5 when successful!!!////////////////
c=5;
char c1[c];
in.read((char *)c1,sizeof(c1));
//cout<<c1<<endl;
}
in.close();
out.close();
// cout<<endl;
// }
return 0;

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
C/C++時(shí)間函數(shù)的使用
C/C++中各種類型int、long、double、char表示范圍(最大最小值)
c++指針經(jīng)典應(yīng)用,多年學(xué)習(xí)筆記,不看后悔
C++ 數(shù)據(jù)類型
sizeof用法總結(jié)(個(gè)人感覺非常好的一篇文章)
比較sizeof()與strlen()
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服