Allocate memory on stack: int arr[5];
→ function을 exit할 때 자동으로 free됨
Allocate memory on Heap: int arr = (int)malloc(5sizeof(int));
→ free(arr); 을 통해서 메모리 관리 가능
#include <stdio.h>
#include <string.h>
int main(){
int T, R, j=0;
char S[20];
scanf("%d", &T);
for(int i = 0; i < T; i++){
j = 0;
scanf("%d", &R);
scanf("%s", S);
while(strcmp(&S[j], "")){
for(int x = 0; x < R; x++){
printf("%c", S[j]);
}
j++;
}
printf("\n");
}
return 0;
}