惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Hacker News
The Hacker News
F
Full Disclosure
Cloudbric
Cloudbric
Blog — PlanetScale
Blog — PlanetScale
W
WeLiveSecurity
N
News and Events Feed by Topic
T
Troy Hunt's Blog
V2EX - 技术
V2EX - 技术
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
B
Blog
GbyAI
GbyAI
C
Check Point Blog
B
Blog RSS Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Recorded Future
Recorded Future
The Last Watchdog
The Last Watchdog
N
News and Events Feed by Topic
T
The Blog of Author Tim Ferriss
O
OpenAI News
V
V2EX
人人都是产品经理
人人都是产品经理
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
WordPress大学
WordPress大学
www.infosecurity-magazine.com
www.infosecurity-magazine.com
S
Security @ Cisco Blogs
C
Cisco Blogs
Security Latest
Security Latest
S
Security Affairs
V
Visual Studio Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
Last Week in AI
Last Week in AI
AWS News Blog
AWS News Blog
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
PCI Perspectives
PCI Perspectives
博客园_首页
U
Unit 42
Google DeepMind News
Google DeepMind News
Hugging Face - Blog
Hugging Face - Blog
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
N
Netflix TechBlog - Medium
L
LINUX DO - 热门话题
H
Hacker News: Front Page

博客园 - wasd

pear安装步骤 linux定时任务的设置 js-tips 用optgroup 禁用select中的option方法 - wasd - 博客园 DB2常用语句记录 addslashes、get_magic_quotes_gpc函数、stripslashes函数(转来记录一下) - wasd - 博客园 Linux 强制卸载软件 - wasd - 博客园 Setup locally visual host - wasd B:X星球的身份证系统 B:有道搜索框 B:有道饭团 A:另类的异或 C:Sibonacci - wasd - 博客园 CakePHP支持DB2 PHP 的变量 - wasd - 博客园 DB2 SQLSTATE 消息异常 JDBC中Preparedstatement使用小结 及JDBC插入数据后获得Last insert ID 并行计算简介 PB3编译adobe的例子photoviewer时错误处理
C语言字符串拆分,打开关闭文件 - wasd - 博客园
wasd · 2010-12-20 · via 博客园 - wasd

#include<stdio.h>
#include<string.h>
void main()
{
    FILE *stream;
    stream = fopen("EMA.txt", "r");
    if(!stream)
    {
        printf("open file error");
        return 0;
    }
    char num[4000][100];
    char SysStockCode[4000][9];
    char StockCode[4000][6];
    char BourseNo[4000][2];
    char values[4000][15];
    char tempTotal[50] = "\0";
    int i=0;
    char seps[] = ",";
    char star[] = ".";
    while(fgets(tempTotal,100,stream))
    {
        int count =0;
        char *token;
        tempTotal[strlen(tempTotal)-1]='\0';//ɾ³ý×îºóµÄ»Ø³µ×Ö·û
        strcpy(num[i],tempTotal);
        token = strtok( tempTotal, seps );

        while( token != NULL )
        {
            if(count%3==0)strcpy(SysStockCode[i], token);
            else if(count%3==2)strcpy(values[i], token);
            token = strtok( NULL, seps );
            count++;
        }
       
        char *wordToken;
        char tempCode[9]= "\0";
        strcpy(tempCode,SysStockCode[i]);
        wordToken = strtok( tempCode, star );
        strcpy(StockCode[i],wordToken);
        wordToken = strtok( NULL, star);
        strcpy(BourseNo[i],wordToken);
        delete  wordToken;
        //printf("All:%s,SysStockCode:%s,StockCode:%s,BourseNo:%s,values:%s\n",num[i],SysStockCode[i],StockCode[i],BourseNo[i],values[i]);
        i++;
    }
    printf("%d",i);
    fclose(stream);
}