Basically you would decide what types you want to support then prompt the user first which type, then which value, and you could use a switch to perform the input:
Code:
printf("Enter type (1=int, 2=char) : ");
fgets(buf,30,stdin);
utype=atoi(buf);
printf("Enter value : ");
fgets(buf,30,stdin);
switch (utype)
{
case 1: // int
  ival=atoi(buf);
  break;
case 2: // char*
  strcpy(sval,buf);
  break;
}
printf("You entered a");
switch(utype)
{
case 1: // int
  printf("n integer, value '%d'\n",ival);
  break;
case 2: // char*
  printf(" string, value '%s'\n",sval);
  break;
}
or something like that (not compiled so there could be some silly errors, but this should give you the idea).
IndiraP like this