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

📄 fgetl.txt

📁 Dos6.0
💻 TXT
字号:
SUMMARY fgetl fputl

#include <tools.h>

int fgetl(pbuf, len, pFile);
char *pbuf;
int len;
FILE *pFile;

int fputl(pbuf, len, pFile);
char *pbuf;
int len;
FILE *pFile;

DESCRIPTION

fgetl gets the next line from the specified file.  CR and LF are removed
and line is terminated with '\0'.  len is the max number of characters
that may be stored into pbuf.  Returns zero if EOF and no characters written
else returns non-zero.  Tabs, \t, are replaced by appropriate number of
blanks to reach the next tab stop.  Tabs tops are at n*8 for n greater
than or equal to zero.

fputl writes a line to the specified file from pbuf and appends "\r\n" to
indicate end of line.  If EOF on output returns EOF else returns 0.
Tabs are not expanded on output.

RETURN VALUE

See above.

IMPLEMENTATION


SEE ALSO  getl putl pathopen mgetl 

NOTE


EXAMPLE

#include <tools.h>

#define BUFLEN 256
char strPath[MAXPATHLEN];
char bufInput[BUFLEN];
char strLine[BUFLEN];

main(c, argv)
int c;
char *argv[];
{
    FILE *pFile;

    if ((pFile = pathopen("$USER:\\tools.ini", strPath, "r"))) {
        printf("Expanded pathname: %s\n", strPath);
        while (fgetl(strLine, BUFLEN, pFile))
            printf("%s\n", strLine);
        }
}

⌨️ 快捷键说明

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