I am a newbie and just learning about strings. I am trying to create a program that accepts a floating point, an integer,and a character.
The program must have a call function that assembles the input data into a string. It must display the assembled string using puts() call back after the main function has completed. Here's what I have, but Have the following errors and cannot figure it out. Any help is greatly appreciated.
Code:
#include <stdio.h>
void combine (char *, int, float*);
int main()
{
char strng1[80],strng2[100];
int num, char*,float*;
printf("enter a string:");
gets(strng1);
printf("enter an integer number:");
scanf("%d", &num);
printf("enter a character:");
scanf("%c", &char*);
printf("enter a floating point:");
scanf("%f",&float*);
combine (strng1, strng2, int, float*,char*);
printf("A string containing all inputs is:");
puts(strng2);
return 0;
}
void combine(char*source,char *dest, int,float*)
{
sprintf(dest,"%c%d%1f",source, float*);
return;
}