#include<iostream.h>
void increase(void*data, int type)
{
switch (type)
{
case Size of(char):(*((char*)data))++;break;
case Size of(short):(*((short*)data)++;break;
case Size of(long): (*((long*)data))++;break;
{
}
int main ()
}
char a=5
short b=9
long c=12
increase (20, Size of(a));
increase (&b, Size of(b));
increase (&c, Size of(c));
cout<<(int) a<<","<<b<<",",<<c;
return 0;
}
Tidak ada komentar:
Posting Komentar