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

📄 scanf1.c

📁 c和指针 学习c语言必须阅读的书籍之一 提高对C语言的掌握理解能力
💻 C
字号:
/*
** Line-oriented input processing with sscanf
*/
#include <stdio.h>
#define	BUFFER_SIZE	100	/* Longest line we'll handle */

void
function( FILE *input )
{
	int	a, b, c, d, e;
	char	buffer[ BUFFER_SIZE ];

	while( fgets( buffer, BUFFER_SIZE, input ) != NULL ){
		if( sscanf( buffer, "%d %d %d %d %d",
		    &a, &b, &c, &d, &e ) != 4 ){
			fprintf( stderr, "Bad input skipped: %s",
			    buffer );
			continue;
		}

		/*
		** Process this set of input.
		*/
	}
}

⌨️ 快捷键说明

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