|
|
Using a 2D char array to store a list. |
|
#include <stdio.h> int main(void) { char names[3][30]; int i; for(i = 0 ; i < 3 ; i++) { printf("\nName %d :", i + 1); gets(names[i]); } printf("\nDisplaying names : "); for(i = 0 ; i < 3 ; i++) printf("\n%s", names[i]); return 0; }
|
|
|
|
|
|
|
|