L
Les Coover
Consider this source code
/* str_test */
#include <stdio.h> /* standard header */
int main(void)
{
int id, number;
char in_string[]= "2 blue 6";
char out_string[100], tmp[100];
sscanf(in_string, "%d %s %d", &id, tmp, &number);
sprintf(out_string, "%d %s %d \n", id, tmp, number);
printf("%s", out_string);
return (0);
}
When compiled and executed the screen output is 2 blue 6
But how can I enter 2 blue 6 FROM THE KEYBOARD and have the program
give the same output?
Thanks,
Les
/* str_test */
#include <stdio.h> /* standard header */
int main(void)
{
int id, number;
char in_string[]= "2 blue 6";
char out_string[100], tmp[100];
sscanf(in_string, "%d %s %d", &id, tmp, &number);
sprintf(out_string, "%d %s %d \n", id, tmp, number);
printf("%s", out_string);
return (0);
}
When compiled and executed the screen output is 2 blue 6
But how can I enter 2 blue 6 FROM THE KEYBOARD and have the program
give the same output?
Thanks,
Les