title: How to get char* with unknown length in C?
body: <p>I have a C code like below:  </p>
  
  <pre><code>char* text;
  get(text); //or
  scanf("%s",text);
  </code></pre>
  
  <p>But I try to run this it breaks. Because I did not give size for <code>text</code>.<br>
  Why I did not give a size for <code>text</code>, because i don't know what is the size of
  text that user is going to enter. 
  So, what can i do, in situations like this?
  How can I read the text if I don't know the length of string?</p>