author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Tue, 11 Oct 2016 15:14:59 +0100 | |
changeset 477 | b2c5a721f360 |
parent 236 | 40efc28963af |
permissions | -rw-r--r-- |
234
17e0efbec5d0
added a more sophisticated formatstring program
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
#include<stdio.h> |
17e0efbec5d0
added a more sophisticated formatstring program
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2 |
#include<string.h> |
17e0efbec5d0
added a more sophisticated formatstring program
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
|
17e0efbec5d0
added a more sophisticated formatstring program
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
int main(int argc, char **argv) |
236
40efc28963af
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
235
diff
changeset
|
5 |
{ char buf[10]; |
40efc28963af
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
235
diff
changeset
|
6 |
snprintf(buf, sizeof buf, argv[1]); |
234
17e0efbec5d0
added a more sophisticated formatstring program
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
7 |
printf ("Input: %s \n", buf); |
17e0efbec5d0
added a more sophisticated formatstring program
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
} |