fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. char a[] = "hello people";
  6. char b[] = "hello other people";
  7.  
  8. char *ar[2];
  9. ar[0] = &(a[0]); //the () are not necessary here
  10. ar[1] = &(b[0]); //but it makes it easier to read
  11.  
  12. printf("a=%s\n", ar[0]);
  13. printf("b=%s\n", ar[1]);
  14. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
a=hello people
b=hello other people