47 string _bar =
"asdfkhasdlkfjhasdlkfhjalksdjfhalksdjhfalksdjfhalksdjhf";
52 memcpy(bar, _bar.c_str(),
length);
56 cprintf(
"%shits%%s + %smisses%%s\n",
"test",
"test");
57 cprintf(
"%%s%-10s %c he went home \'\"%d %#o %#x %1.5f %1.2E\n",
58 "hello",
'A', 1, 0xff, 0xfffffffffffffULL, 3.141592653589, 1.1e10);
63 ccprintf(buffer,
"%-10s %c he home \'\"%d %#o %#x %1.5f %1.2E\n",
64 "hello",
'A', 1, 0xff, 0xfffffffffffffULL, 3.14159265, 1.1e10);
66 double f = 314159.26535897932384;
68 #define ctest(x, y) printf(x, y); cprintf(x, y); cprintf("\n");
76 ctest(
"%1000.8f\n", f);
99 f = 0.00000026535897932384;
106 ctest(
"%12.8f\n", f);
117 ctest(
"%1.10f\n", f);
118 ctest(
"%1.11f\n", f);
119 ctest(
"%1.12f\n", f);
120 ctest(
"%1.13f\n", f);
121 ctest(
"%1.14f\n", f);
122 ctest(
"%1.15f\n", f);
123 ctest(
"%1.16f\n", f);
124 ctest(
"%1.17f\n", f);
125 ctest(
"%1.18f\n", f);
127 f = 0.00000026535897932384;
134 ctest(
"%12.8e\n", f);
145 ctest(
"%1.10e\n", f);
146 ctest(
"%1.11e\n", f);
147 ctest(
"%1.12e\n", f);
148 ctest(
"%1.13e\n", f);
149 ctest(
"%1.14e\n", f);
150 ctest(
"%1.15e\n", f);
151 ctest(
"%1.16e\n", f);
152 ctest(
"%1.17e\n", f);
153 ctest(
"%1.18e\n", f);
155 cout << buffer.str();
161 string foo1 =
"string test";
165 foo2 <<
"stringstream test";
175 cprintf(
"%0*.*f\n", 8, 4, 99.99);
void ccprintf(cp::Print &print)
void cprintf(const char *format, const Args &...args)