-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathseven.c
50 lines (36 loc) · 901 Bytes
/
seven.c
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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
int rows = 100;
int colums = 30;
int x ;
int times;
// kullanicidan kac tane isme iste
printf("kac tane isim gireceksin? ");
scanf("%d" ,×);
printf("\n");
// 'Allocate' 2D M
char** name = (char**)malloc(rows * sizeof(char*));
for ( x = 0; x < rows; x++) {
name[x] = (char*)malloc((colums + 1) * sizeof(char));
}
// kullanicidan isimler oku
for ( x = 0; x < times; x++) {
printf("%d. ismi girin: ", x + 1);
scanf("%s", name[x]);
printf("\n");
}
// isimler ekran yaz
printf("Girilen isimler:\n");
printf("\n");
for ( x = 0; x < times; x++) {
printf("%s\n", name[x]);
}
// Deallocate
for ( x = 0; x < rows; x++) {
free(name[x]);
}
free(name);
return 0;
}