← 返回列表

传递一个无符号长指针

传递一个无符号长指针 #include <stdio.h> #include <time.h> void getSeconds(unsigned long *par); int main () { unsigned long sec; getSeconds( &sec ); /* print the actual value */ printf("Number of seconds: %ld\n", sec ); return 0; } void getSeconds(unsigned long *par) { /* get the current number of seconds */ *par = time( NULL ); return; }

传递一个无符号长指针

#include <stdio.h>

#include <time.h>



void getSeconds(unsigned long *par);



int main () {



   unsigned long sec;

   getSeconds( &sec );



   /* print the actual value */

   printf("Number of seconds: %ld\n", sec );



   return 0;

}



void getSeconds(unsigned long *par) {

   /* get the current number of seconds */

   *par = time( NULL );

   return;

}

打开资源 ↗

交流与评论