丢人了,学C到现在,竟然不知道,不定参数还可以这样。。。。。
#include "iostream"
using namespace std;
int fun(int sum,...)
{
int *temp=∑
temp++;
for(int i=0;i<sum;i++)
{
cout<<*temp<<" ";
temp++;
}
cout<<endl;
return 0;
}
int main()
{
int a=1;
int b=2;
int c=3;
char d='c';
fun(4,a,b,c,d);
return 0;
}
阅读全文