[標準、ファイル、文字列]入力よりデータを所得する時に使用する関数です。
scanf - 標準入力
fscanf - ファイル入力
sscanf - 文字列からの入力
#include <stdio.h>
int scanf(const char *format, ...);
int fscanf(FILE *stream, const char *format, ...);
int sscanf(const char *str, const char *format, ...);
/* 日付データ[23:50]を分解 */ int iH, iM; char cDate = "23:50"; /* 分解 */ sscanf (cDate, "%2d:%2d", &iH, &iM); /* 表示 */ printf ( "%02d時%02d分です。\n", iH, iM);