title: How to run valgrind with basic c example?
body: <p>Installation:</p>
  
  <pre><code>bzip2 -d valgrind-3.10.1.tar.bz2
  tar -xf valgrind-3.10.1.tar 
  </code></pre>
  
  <p>then:</p>
  
  <pre><code>./configure
  make
  make install
  </code></pre>
  
  <p>or simplier </p>
  
  <pre><code>sudo apt-get install valgrind
  </code></pre>
  
  <p>How to run valgrind on that simple program example1.c</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  int main()
  {
      char *x = malloc(100); /* or, in C++, "char *x = new char[100] */
      return 0;
  }
  </code></pre>
  
  <p>Run:</p>
  
  <pre><code>valgrind --tool=memcheck --leak-check=yes example1
  valgrind: example1: command not found
  </code></pre>
  
  <p>Output from console:</p>
  
  <pre><code>valgrind: example1: command not found
  </code></pre>