-
So can I make the combine function return str1? Putting str1 at the beginning of the function prototype? Also for my problem with my linked list, needing to have another prompt to add to the linked list and redisplay: should I use the pop or insert function? I have never used either, but I think I need to. I am not sure how
-
I tried to make those changes, but it seems to have more errors.
insert
Code:
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
char combine(char*new_str1, int n, char c, float f);
char str1[100];
int n;
char c;
float f;
printf("\nEnter an integer:\n");
scanf_s("%d", &n);
printf("\nEnter a character:\n");
scanf_s("%c", &c);
printf("\nEnter a floating point number:\n");
scanf_s("%f", &f);
combine(str1, n,c,f);
puts(str1);
return 0;
}
char combine(char*new_str1, n, c, f,)
{
str1=sprintf_s(str1, "%d, %c, %f", n,c,f);
return (str1);
}