c++ fstream when see string in file : <p>I made a code but it doesn't work.Can you help? In code, I wanted to take a line and if code see <strong>//n</strong>, end line.</p>

<p>Here is my example.<br>
File:</p>

<pre><code>I love C++! //n
</code></pre>

<p>My Code:</p>

<pre><code>ifstream file("file.txt");
char text[250];
while(file &gt;&gt; text){
  cout &lt;&lt; text &lt;&lt; " ";
  if(text == "//n"){
    cout &lt;&lt; endl;
  } 
}
</code></pre>

<p>Thanks for your help.</p>
