⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 load.c

📁 目前已经有很多介绍计算机网络的书籍
💻 C
字号:
/* * Load tickers from tickets.rc : */#include "quotes.h"intload(TickReq *tick,int *pntick,int nmax) {    int ntick = *pntick;    FILE *tickf = NULL;    char *cp;    char buf[256];    int lno = 0;    memset(tick,0,sizeof *tick * ntick);    /*     * Open tickers.rc file :     */    tickf = fopen(TICKPATH,"r");    if ( !tickf ) {        msgf('e',"%s: opening %s for reading",            strerror(errno),TICKPATH);        return -1;    }    /*     * Load tickers from file :     */    while ( fgets(buf,sizeof buf,tickf) ) {        ++lno;        cp = strtick(buf);        if ( cp - buf <= 0 ) {            msgf('e',"Line %d: Bad ticker\n",                lno);            continue;        }        /*         * Load one more ticker :         */        *cp = 0;        strncpy(tick[ntick].ticker,            buf, TICKLEN)[TICKLEN] = 0;        tick[ntick].flags = 0;        tick[ntick++].next_samp = 0;        /*         * Don't load beyond the array limits:         */        if ( ntick >= nmax ) {            msgf('w',                "Stopping at max of %d tickers.",                ntick);            break;        }    }    fclose(tickf);    msgf('i',"%d tickers loaded.",ntick);    *pntick = ntick;    /* Return count */    return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -