fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. char *country[]={"USA\n","UK\n","Chaina\n","Singapore\n","Scotland\n"};
  6. for (int i =0; i <5; i++) {
  7. printf("\n CHECK val=%s\n",country[i]);
  8. }
  9. char **cp = &country[2];
  10. for (int i = 0; i < 3 ; i++) {
  11. printf("\n POINTER val=%s\n", cp[i]);
  12. }
  13.  
  14.  
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
 CHECK val=USA


 CHECK val=UK


 CHECK val=Chaina


 CHECK val=Singapore


 CHECK val=Scotland


 POINTER  val=Chaina


 POINTER  val=Singapore


 POINTER  val=Scotland