一.何谓可变参数 int printf( const char* format, ...); 这是使用过C语言的人所再熟悉不过的printf函数原型,它的参数中就有固定参数format和可变参数(用"-"表示). 而我们又可以用各种方式来调用printf,如: printf( "%d ",value); printf( "%s ",str); printf( "the number is %d ,string is:%s ",…
摘自http://www.cplusplus.com 1. scanf 函数 int scanf ( const char * format, ... ); Parameters format C string that contains a sequence of characters that control how characters extracted from the stream are treated: Whitespace character: the function wil…
#include <stdio.h> int main(void) { int a = 4; int b = 3; int c = a / b; float d = *(float *)(&c); long long e = 0xffffffffffffffff; printf("a/b:%f,a:%d\n", a / b, a, b); //打印0 printf("(float)a/b:%f\n", ((float)a) / b); //打印1…