C
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
#include <stdio.h>
typedef struct{
int n;
char* s;
} data;
int main() {
data L1 = {3, (char[]){'a','b','c'}};
data L2 = {10, (char[]){'d', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'}};
data L3 = {4, (char[]){'n', 'o', 'p', 'q',}};
// using array instead of char* *p1, *p2, *p3;
data p[3] = {L1, L2, L3};
for(int i=0;i<3; i++){
printf("(%d, \"", p[i].n);
for(int j=0; j<p[i].n; j++)
printf("%c", p[i].s[j]);
puts("\")\n");
}
}
/*
Bob_Li my understanding is different from your example. I think this sample matches the input criteria:
char *p = {
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run