fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. #define NUM_RECORD 10
  5. #define NAME_LENGTH 30
  6.  
  7. void FUNC( char name[][NAME_LENGTH] )
  8. {
  9. strcpy(name[0], "John Tennon") ;
  10. strcpy(name[1], "Bod Tender") ;
  11. strcpy(name[2], "Lemon Tennon") ;
  12. }
  13.  
  14. int main(void)
  15. {
  16. char name[NUM_RECORD][NAME_LENGTH] = {{0}};
  17. FUNC(name) ;
  18.  
  19. for ( int i=0; i < NUM_RECORD; ++i )
  20. printf("%s\n", name[i]);
  21. }
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
John Tennon
Bod Tender
Lemon Tennon