Home » U++ Library support » U++ Core » Format Issues - Dynamic width and alignment
Format Issues - Dynamic width and alignment [message #18866] |
Wed, 29 October 2008 17:48 |
captainc
Messages: 278 Registered: December 2006 Location: New Jersey, USA
|
Experienced Member |
|
|
Hey, I'm trying to use alignment and dynamic widths based on the size of strings with the Format function.
Ex:
Cout() << Format("|%20=s|\n", "test"); // Works as expected
Cout() << Format("|%*=s|\n", 20, "test"); // Seg Fault Heap Corrupted
How can I use * to insert the width I want dynamically?
Update:
Found a small workaround...
String fm("");
int width = 20;
fm.Cat() << "%" << width << "=s";
Cout() << Format(fm, "test");
Would still like to know if it is possible with just 1 formatting line though.
[Updated on: Wed, 29 October 2008 18:05] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Mon Apr 29 11:56:29 CEST 2024
Total time taken to generate the page: 0.02926 seconds
|