I am trying to write a program that accepts input from the keyboard which includes floating poit numbers,character and integers. The value of each shoykd be stored with variable names and the program will call for function that assembles a string using puts() in main after the function has completed.
I am getting 3 errors= combine functions does not have 5 parameters and syntax error &, and function header, Please help!!!!
Code:
#include <stdio.h>
#include <string.h>
void combine (char c, int num, floatnum);
int main()
{
char strng1[80],strng2[100];
int num;
char c;
floatnum;
printf("enter a string:");
gets(strng1);
printf("enter an integer number:");
scanf("%d", &num);
printf("enter a character:");
scanf("%c", &c);
printf("enter a floating point:");
scanf("%f",&floatnum);
combine (strng1, strng2, &num, floatnum, &c );
printf("A string containing all inputs is:");
puts(strng2);
return 0;
}
void combine(char c,char *dest, int num,floatnum)
{
sprintf(dest,"%c%d%1f",source, floatnum);
return 0;
}