snprintf now working! (fixed problem will calls inside calls)
This commit is contained in:
parent
1f9534d750
commit
f7a8a193c2
5 changed files with 44 additions and 8 deletions
|
@ -2,9 +2,9 @@
|
|||
|
||||
int main(int argc, char **argv) {
|
||||
char buf[200] = {0};
|
||||
sprintf(buf, "Hello, %d %.2f %g %s %p\n", 187, 77.3, 349e12, "Wow!", "yea");
|
||||
// snprintf(buf, 200, "Hello\n"); //<- NOT WORKING
|
||||
write(1, buf, sizeof buf);
|
||||
return *buf;
|
||||
snprintf(buf, sizeof buf, "Hello, %d %.2f %g %s %p\n", 187, 77.3, 349e12, "Wow!", "yea");
|
||||
/* write(1, buf, sizeof buf); */
|
||||
printf("%s\n",buf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue