Page 1 of 1

is their anything in the c library like this..

Posted: Sat Sep 30, 2006 8:56 pm
by earlz
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

Re:is their anything in the c library like this..

Posted: Sun Oct 01, 2006 1:30 pm
by Candy
scanf

Re:is their anything in the c library like this..

Posted: Sun Oct 01, 2006 3:04 pm
by earlz
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..

Posted: Sun Oct 01, 2006 11:54 pm
by Candy
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);
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.

Re:is their anything in the c library like this..

Posted: Wed Oct 04, 2006 8:49 am
by dc0d32
can we have a new escape sequence? Or ASCII?

Re:is their anything in the c library like this..

Posted: Thu Oct 05, 2006 11:15 am
by Solar
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".