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

📄 ts_filelen.c

📁 MPICH是MPI的重要研究,提供了一系列的接口函数,为并行计算的实现提供了编程环境.
💻 C
字号:
#include <stdio.h>#define SLOG_PROFILENAME  "SLOG_Profile.txt"/*  Calculate the length of the one stream in "char" ( byte? )  */size_t filelen( FILE *infd ){    int    c;    size_t count;    count = 0;    while ( ( c = fgetc( infd ) ) != EOF ) {        printf( "%d ", c );        if ( c != '\n' ) count++;    }    return count;}main(){	const char filename[] = SLOG_PROFILENAME;	FILE *fd;        fd = fopen( filename, "r" );	printf( "\n the length of %s = %d\n", filename, filelen( fd ) );        printf( "newline character is %d\n", '\n' );        printf( "EOF is %d\n", EOF );        fclose( fd );}

⌨️ 快捷键说明

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