title: How can I debug a C program on Mac Terminal with GCC?
body: <p>I want to debug the C program on my Mac Terminal. I use &quot;gcc -o deng.c&quot;</p>
  <p>P.S: The <em>path</em> is right, but it says &quot;No such file or directory&quot;.</p>
  <p>I have installed Xcode and Commd line already.</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  #define maxn 1000 + 10
  
  int a[maxn];
  
  int main()
  {
      int i, j, n, k, first=1;
      memset (a, 0, sizeof(a));
      scanf(&quot;%d%d&quot;, &amp;n, &amp;k);
  
      for(i=1; i&lt;=k; i++)
          for (j = 1; j&lt;=n; j++)
              if(j%i == 0)
                  a[j] = !a[j];
  
      for(i=1; i&lt;=n; i++)
          if(a[i])
          {
              if(first)
                  first = 0;
              else
                  printf(&quot; &quot;);
              printf(&quot;%d&quot;, i);
          }
  
      printf(&quot;\n&quot;);
      return 0;
  }
  </code></pre>