Keil Logo

where does sprintf output go?

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
erik malund
Posted
27-Sep-2011 14:37 GMT
Toolset
ARM
New! where does sprintf output go?

I have searched the documentation for a good while and not been able to find the answer to the above.
since similar may come up again a link to the answer, may be more helpful than just the answer.

in advance, thanx,

Erik

Read-Only
Author
Tamir Michael
Posted
27-Sep-2011 14:50 GMT
Toolset
ARM
New! RE: where does sprintf output go?

Try searching for "retargeting". That should explain it all.

Read-Only
Author
Tamir Michael
Posted
27-Sep-2011 14:50 GMT
Toolset
ARM
New! RE: where does sprintf output go?

Ho sorry - I misread your post!

Read-Only
Author
Per Westermark
Posted
27-Sep-2011 14:53 GMT
Toolset
ARM
New! RE: where does sprintf output go?

sprintf()?

It prints to a string - string print formatted. So obviously, the output goes to the buffer you supply as parameter.

Are you sure you don't mean the reverse - where do the input come from?

Read-Only
Author
erik malund
Posted
27-Sep-2011 15:22 GMT
Toolset
ARM
New! thanks

I hsve, due to doing '51s for ages where using things like sprintf are "space excessive", forgotten much in this area - it's coming back.

thanx,

Erik

Read-Only
Author
Per Westermark
Posted
27-Sep-2011 15:30 GMT
Toolset
ARM
New! RE: thanks

So you did mean printf() and not sprintf()?

Then it is up to you to supply the function that maps where "serial console" data should be sent.

Read-Only
Author
erik malund
Posted
27-Sep-2011 15:46 GMT
Toolset
ARM
New! RE: thanks

So you did mean printf() and not sprintf()?

nope, I ment sprintf(), my rustiness made me think of printf() - it is all coming back :)

Erik

Read-Only
Author
Andrew Neil
Posted
27-Sep-2011 16:03 GMT
Toolset
None
New! RE: forgotten much in this area

A useful online reference to the Standard 'C' library functions:

http://www.cplusplus.com/reference/clibrary/
(don't worry about the "plusplus" - it is the 'C' library)

And a useful online 'C' textbook:

http://publications.gbdirect.co.uk/c_book/

Read-Only
Author
erik malund
Posted
27-Sep-2011 16:11 GMT
Toolset
None
New! have you noted ...

(don't worry about the "plusplus" - it is the 'C' library)

Have you noted that very few people are capable of writing 'C' any more, it automatically comes out as 'C++'

The last 3 places I have consulted have requested 'C++' although the code (current and added) was pure 'C'

Erik

Read-Only
Author
Hans-Bernhard Broeker
Posted
27-Sep-2011 20:04 GMT
Toolset
None
New! RE: have you noted ...

Have you noted that very few people are capable of writing 'C' any more, it automatically comes out as 'C++'

Actually, for at least a decade now, what you typically get is talk about a non-existant language supposedly called "C/C++". I blame that on a whole slew of books that mashed the two together like that, both in the title and in the text.

Read-Only
Author
Hans-Bernhard Broeker
Posted
27-Sep-2011 20:18 GMT
Toolset
ARM
New! RE: where does sprintf output go?

I have searched the documentation for a good while and not been able to find the answer to the above.

Makes one wonder what documentation you searched. The Keil Cx51 manual could hardly be any clearer on the issue: "... and stores the resulting string in buffer."

Read-Only
Author
erik malund
Posted
28-Sep-2011 13:58 GMT
Toolset
ARM
New! RE: where does sprintf output go?

Makes one wonder what documentation you searched
I clicked and clicked at the Keil site, the search gave a lot of useless hits

Erik

Read-Only
Author
Andrew Neil
Posted
28-Sep-2011 14:56 GMT
Toolset
ARM
New! RE: The Keil Cx51 manual could hardly be any clearer

But the Keil MDK-ARM online documentation could hadly be any more impenetrable!

Once you find it, the content is OK - but trying to find stuff is a complete nightmare!

Read-Only
Author
Per Westermark
Posted
28-Sep-2011 15:00 GMT
Toolset
ARM
New! RE: The Keil Cx51 manual could hardly be any clearer

Yes, it does take a bit of time to learn how to use the Keil web site. And to know when it shouldn't be used because the required information has to be fetched from another ARM site.

Read-Only
Author
Hans-Bernhard Broeker
Posted
28-Sep-2011 18:44 GMT
Toolset
ARM
New! RE: The Keil Cx51 manual could hardly be any clearer

But the Keil MDK-ARM online documentation could hadly be any more impenetrable!

Ah, that might be the difference --- as you'll note, I was looking in the C51 docs.

But then again, that's a fundamental feature of a C Standard Library function Erik was looking for, so it shouldn't matter which compiler's documentation you look it up in. That much has to be the same everywhere.

Read-Only
Author
erikdo malund
Posted
28-Sep-2011 19:18 GMT
Toolset
ARM
New! sure, but

so it shouldn't matter which compiler's documentation you look it up in.

sure, but if you drove an Audi, would you look up the conversion kpH/MpH in a Mercedes manual it shouldn't matter which.

Erik

Read-Only
Author
Hans-Bernhard Broeker
Posted
28-Sep-2011 21:04 GMT
Toolset
ARM
New! RE: sure, but

if you drove an Audi, would you look up the conversion kpH/MpH in a Mercedes manual

If the mercedes manual just so happens to be at hand, and the Audi one isn't: absolutely!

Read-Only
Author
Jealous Consultant
Posted
28-Sep-2011 21:19 GMT
Toolset
ARM
New! RE: sure, but

Audi? Mercedes?

Do all software developers apart from me earn enough to drive in such luxurious modes of transport? I'm stuck with my jalopy!

Read-Only
Author
erikdo malund
Posted
29-Sep-2011 14:12 GMT
Toolset
ARM
New! well,

I guessed Hans-Bernhard is German :)

In Germant Audi and Mercedes (the smaller ones) are not "Cadillacs" but "Buicks"

Erik

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.