title: malloc with user input
body: <p>I'm trying to make a program where a user inputs a string then if they want to enter a letter they want to replace and what with. I want to use malloc to set the array but how would I do it with scanf?</p>
  
  <p>Please can someone help.</p>
  
  <p>Thanks! </p>
  
  <p>This is what the program looks before going to the replace method:</p>
  
  <pre><code>char *s,x,y;
  
  printf("Please enter String \n");
  scanf("%s ", malloc(s));
  
  printf("Please enter the character you want to replace\n");
  scanf("%c ", &amp;x); 
  
  printf("Please enter replacment \n");
  scanf("%c ", &amp;y);
  
  prinf("%s",s);
  </code></pre>