-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusage.c
More file actions
26 lines (20 loc) · 680 Bytes
/
usage.c
File metadata and controls
26 lines (20 loc) · 680 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "gheader.h"
#include "gdefs.h"
int main(void) {
// Initialize the printer
f_printer *printer = init_fprinter();
// Set the output buffer with a format string
// Format specifiers: $s for string, $d for decimal, $c for character
fprinter_set_buffer(printer, "Character: $c, String: $s, Decimal: $d\n");
// Prepare data to be printed
char ch = 'A';
char *str = "fwriter";
int number = 123;
void *data[] = { &ch, str, &number, NULL };
fprinter_set_data(printer, data);
// Perform the printing operation
fast_printer(printer);
// Clean up resources
free_fprinter(printer);
return 0;
}