C++ char* in methods
<p>Listen people, i want to write a method that gets a line from the user, so i wrote this:</p>

<pre><code>static char* getline(){
                char temp[0];
                cin &gt;&gt; temp;
                return temp;
         }
</code></pre>

<p>I also have a writeline method:</p>

<pre><code>static void writeline(char* text){
 cout&lt;&lt;text&lt;&lt;endl;
 }
</code></pre>

<p>and then i go to the main and wrote this:</p>

<pre><code>writeline(getline());
</code></pre>

<p>and it didnt work..
i want to say that when i wrote this:</p>

<pre><code>static char* getline(){
                char temp[0];
                cin &gt;&gt; temp;
                writeline(getline());
                return temp;
         }
</code></pre>

<p>and i wrote in main this:</p>

<pre><code>getline();
</code></pre>

<p>it did work!</p>

<p>so what do i need to do?</p>
