*在scanf函数中提供完全不同的服务,当把它放在%和说明符字母之间时,它使函数跳过相应的输入项目。

实例程序:

/*scanf()函数中*的用法:如果程序要读取一个文件中某个特定的列(该文件中的数据以统一的列排列时,那么该功能将非常有用)*/

#include <stdio.h>
int main()
{	int n;
	printf("please input four numbers:\n");
	scanf("%*d %*d %*d %d",&n);//注意*在此的用法,scanf()中,加入*代表该值被跳过。
	printf("the last number was: %d \n" ,n);
	return 0;
}

运行结果:wKiom1l7N3ixgTIJAAB8cQODn1A663.png