-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdynamic.c
More file actions
59 lines (36 loc) · 1015 Bytes
/
Copy pathdynamic.c
File metadata and controls
59 lines (36 loc) · 1015 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// #include <stdio.h>
// #include <stdlib.h>
// int main() {
// int capacity = 4;
// int length = 0;
// char *str = malloc(capacity);
// if (str == NULL) {
// return 1;
// }
// char c;
// printf("Please type characters (Type ! to stop):\n");
// while ((c = getchar()) != '!') {
// if (length >= capacity - 1) {
// capacity *= 2;
// char *temp = realloc(str, capacity);
// if (temp == NULL) {
// free(str);
// return 1;
// }
// str = temp;
// }
// str[length] = c;
// length++;
// }
// str[length] = '\0';
// printf("\nFinal string: %s\n", str);
// printf("Length: %d\n", length);
// printf("Capacity: %d\n", capacity);
// free(str);
// return 0;
// }
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("%d, %s, %s, %s", argc, argv[0], argv[1], argv[2]);
return 0;
}