title: How can I store String value in char array in C?
body: <p>I have char array to store string values. I wanted to store the value of a string variable into the char array. </p>
  
  <pre><code>char Password[30];
  char User[2];
  int i;
  
  for(i=0; i&lt;5; i++) {
          printf("Enter Password");
          scanf("%s", Password);
          strcpy(User[i],Password,30);
  }
  </code></pre>
  
  <p>I wanted to input the values for the array and it should throw a buffer overflow but I couldn't do it. How can I do it?</p>