Commit | Line | Data |
---|---|---|
c906108c | 1 | #include <stdio.h> |
085dd6e6 JM |
2 | #include <stdlib.h> |
3 | #include <string.h> | |
4 | ||
c906108c SS |
5 | char buf[100]; |
6 | char bigbuf[1000]; | |
7 | char * s; | |
8 | ||
085dd6e6 JM |
9 | #ifdef PROTOTYPES |
10 | char * str_func1(char *s1) | |
11 | #else | |
c906108c SS |
12 | char * str_func1(s1) |
13 | char *s1; | |
085dd6e6 | 14 | #endif |
c906108c SS |
15 | { |
16 | printf("first string arg is: %s\n", s1); | |
17 | strcpy(bigbuf, s1); | |
18 | return bigbuf; | |
19 | } | |
20 | ||
085dd6e6 JM |
21 | #ifdef PROTOTYPES |
22 | char * str_func( | |
23 | char * s1, | |
24 | char * s2, | |
25 | char * s3, | |
26 | char * s4, | |
27 | char * s5, | |
28 | char * s6, | |
29 | char * s7) | |
30 | #else | |
c906108c SS |
31 | char * str_func(s1, |
32 | s2, | |
33 | s3, | |
34 | s4, | |
35 | s5, | |
36 | s6, | |
37 | s7) | |
38 | char * s1; | |
39 | char * s2; | |
40 | char * s3; | |
41 | char * s4; | |
42 | char * s5; | |
43 | char * s6; | |
44 | char * s7; | |
085dd6e6 | 45 | #endif |
c906108c SS |
46 | { |
47 | printf("first string arg is: %s\n", s1); | |
48 | printf("second string arg is: %s\n", s2); | |
49 | printf("third string arg is: %s\n", s3); | |
50 | printf("fourth string arg is: %s\n", s4); | |
51 | printf("fifth string arg is: %s\n", s5); | |
52 | printf("sixth string arg is: %s\n", s6); | |
53 | printf("seventh string arg is: %s\n", s7); | |
54 | strcpy(bigbuf, s1); | |
55 | strcat(bigbuf, s2); | |
56 | strcat(bigbuf, s3); | |
57 | strcat(bigbuf, s4); | |
58 | strcat(bigbuf, s5); | |
59 | strcat(bigbuf, s6); | |
60 | strcat(bigbuf, s7); | |
61 | return bigbuf; | |
62 | } | |
63 | ||
0f71a2f6 JM |
64 | char * |
65 | link_malloc () | |
66 | { | |
67 | return (char*) malloc (1); | |
68 | } | |
c906108c | 69 | |
085dd6e6 | 70 | int main() |
c906108c SS |
71 | { |
72 | s = &buf[0]; | |
73 | strcpy(buf, "test string"); | |
74 | str_func("abcd", "efgh", "ijkl", "mnop", "qrst", "uvwx", "yz12"); | |
75 | str_func1("abcd"); | |
085dd6e6 | 76 | return 0; |
c906108c SS |
77 | } |
78 |