1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| #include "usg_common.h"
| #include "usg_typedef.h"
|
| int test(char *src, int size) {
| int i = strlen(src);
| char dest[size];
| strncpy(dest, src, size);
| puts(dest);
| return i;
| }
| int main() {
| char *str = "hello";
| int r = test(str, strlen(str));
| printf("%d\n", r);
| }
|
|