Some Guidelines on Pointers
So when do you use * and &?

Pointer specification and deferencing traditionally cause more problems for programmers in C than anything else. The following is a short summary of their usage which, whilst not complete, should be sufficient to reduce the debugging strategy of arbitrarily inserting /removing & or * in the code and thinking positive thoughts.

If you want a more extended example of using * and &

 
/* pointers.c -  */

main(int argc, char **argv)
{
      int   i,j;
      char* string;
      printf("\t\t\tMemory Location/Type\n");
      printf("Name\t\t\tchar**\tchar*\tchar\t\tValue\n\n");
      
      printf("argv  \t\t\t%d \t\t\t%d \n",&argv, argv); 
  
      for (i=0;i<argc;i++) 
      {
            printf("   argv[%d] \t\t\t%d \t\t%d  \n",i,&argv[i],argv[i]); 
            for (j=0;*(argv[i]+j)!=0;j++)
            {
                  printf("\t argv[%d][%d] \t\t\t%d \t%c \n",i,j,&argv[i][j],argv[i][j]);
             }
            printf("\t *(argv[%d]+%d) \t\t\t%d \tNULL \n",i,j,argv[i]+j);
      }

      printf("\n\nNOTE FROM THE ABOVE THAT\n\n");
      printf("1. If a variable NAME is of type XXX**, then it represents a list of addresses\n");
      printf("   and its value is the address of the head, %d , of the list\n\n",argv);
      printf("2. Each element of the list is of type XXX* and represents a list of XXX's\n");
      printf("   and the ith element is the address of the start, %d for i=0,of \n",argv[0]);
      printf("   list NAME[i]. Since each element is a pointer, it is %d bytes long\n\n",sizeof(char*));
      printf("3. Each element of NAME[i] is of type XXX and of length %d byte(s)\n",sizeof(char));
      printf("   It can be referred to as NAME[i][j] or as *(NAME[i]+j) i.e. the value of \n");
      printf("   the element located j*sizeof(XXX) bytes from the start of NAME[i] e.g.\n");
      printf("    argv[0][1]   located at %d with value %c is the same as\n",&argv[0][1],argv[0][1]);
      printf("    *(argv[0]+1) located at %d with value %c \n\n\n",argv[0]+1,*(argv[0]+1));

}