Hello to All
what is the different between printf & sprintf and scanf & sscanf
I read the help but i dont understand it
printf("Hello world \n"); aprintf("Hello world \n"); ------------------------------ int k; scanf("%d",k); sscanf("%d",k);
.
Thanks = 10x
Mayer
printf("Hello world \n"); sprintf("Hello world \n"); // You are missing a parameter, and that is your answer.
i understand what the fuction sprintf it does
but for what it good for ???
what is the usage of the function if i dont use it like printf with the serial port
i can use strcpy strcpyn strcat strncat and get the same result
??!!
Please tell me how you would use strcpy(), ... to process an integer zero-filled to five positions? Or how would you use your suggested functions to know the address value of a pointer?
Do you really think that "formatted" in this case is the same as strcpy()? That sounds more like unformatted printing.
If printf() is configured to emit the text to your first serial port, how would you emit text to a memory region in your flash, or on the SPI bus or on a LCD display?
mayer, please don't be offended by the responses here. the people that reply are generally good guys who know a lot, and sometimes they are a little short of breath, too (so am I, sometimes...) you can use sprintf to format data in a certain way. you can easily "mix" types into a destination buffer, before you do something with it. for example, you can format a floating point number according to a predefined desire and have it end up into your buffer. in addition, you can typecast with it. now go read the specification, think again about what you were told here and you'll be alright.
View all questions in Keil forum