Does anyone know what the purpose of the sprintf and sscanf statements for this program are for? I do not understand these 2 functions at all. Thanks......
Code:
#include <stdio.h>
#include <conio.h>
int main()
{
char array[80];
int num1=1;
int num2=2;
sprintf(array,"%d" "%d", num1, num2);
puts(array);
char data[]="$23.45 10";
char dol;
float price;
int units;
scanf(data,"%c%f %d", &dol,&price,&units);
printf("\n%c%5.2f %d\n", dol, price, units);
getch();
return 0;
}
*****Output with the SSCANF and SPRINTF Function********
/*
12
$23.45 10
*/
*****Output with the SCANF and SPRINTF Function*********
/*
12
*/