title: Why doesn't grep return TRUE in C++?
body: <p>I'm adapting some of my code from Bash to C++ and I have no idea why this allways returns FALSE.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdlib.h&gt;
  
  int main() {
      if ( system ("grep -q zswap.enabled=1 /etc/default/grub") ) {
          std::cout &lt;&lt; "   zswap.enabled=1 ?: Yes\n";
      }
      else {
          std::cout &lt;&lt; "   zswap.enabled=1 ?: No\n"; 
      }
      return 0;
  }
  </code></pre>