如何正确地传递这种参数?
本意是查到sizeof(int),sizeof(long)这样的大小,想玩得高级点用个指针数组,却不成功.能指点一下怎么用数组实现吗?#include <string.h>
#include <stdio.h>
int main()
{
char *p;
char *name[]={"char","int","short","long","float","double"};
int i;
for (i=0;i<6;i++){
printf("%s:\t%u\n",name[i],sizeof(name[i]));
}
return 0;
}