title: Problems in three dimension array in C
body: <p>I defined the three dimensional array like this, but I it can't read any string in it? Where is the problem? Thanks!</p>
  
  <pre><code>int stuTotal, courseTotal,i,k;//a dynamic array
  printf("Input the total number of students that you would like to import:");
  scanf("%d", &amp;stuTotal);
  printf("Input the total number of courses that you would like to import:");
  scanf("%d", &amp;courseTotal);
  
  char ***data = (char***)calloc(stuTotal,sizeof(char));//data
  for(i = 0;i &lt; stuTotal;i++){
      data[i] = (char**)calloc(courseTotal,sizeof(char));
      for (k = 0;k &lt; courseTotal;k++){
          data[i][k] = (char*)calloc(20,sizeof(char));
      }
  }
  strcpy(data[0][0],"hello");
  </code></pre>
  
  <p>data[0][0] is shown to be empty.</p>