| View previous topic :: View next topic |
| Author |
Message |
darkeagle
Joined: 18 Feb 2010 Posts: 2
|
| vsprintf: available in ccs? |
Posted: Fri May 07, 2010 7:10 am |
|
|
As the object, is the vsprintf available in ccs compiler?
Thanks
d |
|
 |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
 |
pippo1234
Joined: 07 May 2010 Posts: 1
|
|
Posted: Fri May 07, 2010 4:03 pm |
|
|
Tested the sprintf with variable parameters but it does not work.
I think is necessary to write a vsprinft from scratch.
Anyone know a workaround?
P |
|
 |
bkamen
Joined: 07 Jan 2004 Posts: 1619 Location: Central Illinois, USA
|
|
Posted: Fri May 07, 2010 5:46 pm |
|
|
There's a typo in the sample at that link, but I got it to compile..
Just didn't run it.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
 |
allenhuffman
Joined: 17 Jun 2019 Posts: 680 Location: Des Moines, Iowa, USA
|
|
Posted: Tue Oct 20, 2026 8:38 am |
|
|
I ran into a use for this today, and ended up here. Can confirm no vargs support in sprintf.
I have a bunch of places where I populate a buffer that will be returned in a "get debug data" message, and was hoping to make them more clever.
| Code: | // Log what happened.
char buffer[80];
sprintf (buffer, "%d current %f > %u",
index, current, currentLimit);
populateDebugDataBuffer (buffer, sizeof(buffer));
|
Ah well... what's a few more bytes between friends. _________________ Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?
Using: 24FJ256GA106, 24EP256GP202, 24FJ64GA002 and 24FJ1024GA606. |
|
 |
|