摘要: 声明时,C和C++都可以省略形参名,但是通常不建议这样做。在函数定义时,在C语言中,即使不使用形式参数,也不能省略参数名,而在C++中是可以的。#include<stdio.h>#include <stdlib.h>void test(char);intmain(void){ test('a');}void test(char ){ printf("hello\n");}编译如下:lee@ubuntu:~/program/fun$ gcc test_parameter.c test_parameter.c: In function ‘ 阅读全文
posted @ 2012-04-07 16:16 leealways87 阅读(1738) 评论(0) 推荐(0) 编辑