Is their anything in the standard C library that lets you do somethign like.. getstuff("hello type a string: %s\n type soem hex 0x%x \nand at last type a number: %i",string,&hex,&dec);
and it be like gets and such but act like printf
is their anything in the c library like this..
Re:is their anything in the c library like this..
no like this is what I want..
Code: Select all
getf("type your number: %s",num);
rather than
printf("type your number: ");
scanf("%s",num);
Re:is their anything in the c library like this..
How is that code supposed to know what is input and what is output? The point of printf is that it's all output, scanf is all input. You can't practically make a mix between them without assuming a number of things that make a lot of applications impossible.Jordan3 wrote: no like this is what I want..Code: Select all
getf("type your number: %s",num); rather than printf("type your number: "); scanf("%s",num);
Re:is their anything in the c library like this..
can we have a new escape sequence? Or ASCII?
Re:is their anything in the c library like this..
In your own OS API library, you can implement whatever you like. Standard C is defined by the standard document, and doesn't know mixed input / output or "other escape sequences".
Every good solution is obvious once you've found it.