libpipecolors/examples/example2.cpp

18 lines
466 B
C++
Raw Normal View History

2015-07-06 15:29:41 -07:00
#include <cstdio>
#include <iostream>
#include <pipecolors.h>
using namespace pipecolors;
int main(void) {
2015-07-14 08:21:05 -07:00
char buffer[256];
2015-07-06 15:29:41 -07:00
int num = 5;
const char* str = "My number is";
2015-07-14 08:21:05 -07:00
const char* str2 = "|10My number is|07";
int len = pcprintf("|01%s |09%d|39\n", str, num);
2015-07-14 04:12:59 -07:00
pcprintf("|10Length of Len is : |15|30%d\n|07", len);
2015-07-14 08:21:05 -07:00
int len2 = pcsprintf(buffer, "%s %d\n", str2, num);
printf("\n%s %d\n", buffer, len2);
2015-07-06 15:29:41 -07:00
return 0;
}