实例1:传递一个无符号的long型指针给该函数
#include<stdio.h>#include<time.h>void getSeconds(unsignedlong*par);int main (){unsignedlong sec; getSeconds(&sec );/* 输出实际值 */ printf("Number of seconds: %ld\n", sec );return0;}void getSeconds(unsignedlong*par){/* 获取当前的秒数 */*par = time( NULL );return;}
打印结果:
Number of seconds :1294450468