title: Access violation reading location 0x00000000. with argv[]
body: <p>I am running the following program and got errors:</p>
  
  <pre><code>First-chance exception at 0x0f32d440 (msvcr100d.dll) in c.exe: 0xC0000005: Access violation reading location 0x00000000.
  Unhandled exception at 0x772815de in c.exe: 0xC0000005: Access violation reading location 0x00000000.
  The program '[9048] c.exe: Native' has exited with code -1073741510 (0xc000013a).
  </code></pre>
  
  <p>Here is the code</p>
  
  <pre><code>#include &lt;string.h&gt;
  #include &lt;stdio.h&gt; 
  #include &lt;stdlib.h&gt; 
  int main(int argc, char *argv[], char *env[]) //char *argv[] 
  { 
  int i; 
  
  printf("These are the %d command- line arguments passed to main:\n\n", argc); 
  if(strcmp(argv[1],"123")==0)                
      {
          printf("success\n");
       }
  else
  for(i=0; i&lt;=argc; i++) 
      //if(strcmp(argv[1],"abc")==0)
  
      printf("argv[%d]:%s\n", i, argv[i]);
  /*printf("\nThe environment string(s)on this system are:\n\n"); 
  for(i=0; env[i]!=NULL; i++) 
  printf(" env[%d]:%s\n", i, env[i]);*/ 
  system("pause");
  } 
  </code></pre>
  
  <p>The problem should be with the strcmp function but I dont know how to solve it.
  Could anyone help?</p>