title: How to declare a variable using string concatenation and use that variable to print and integer defined as variable in C?
body: <p>Getting output as 0 instead of defined value</p>
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  int main()
  {
  char *val;  
  char MODE_VAR[1000]=&quot;MODE0&quot;;
  int MODE0_SENSE=9;
  
  val= strcat(MODE_VAR,&quot;\_SENSE&quot;);
  printf(&quot;String value = %s, Int value = %d\\n&quot;, MODE_VAR, atoi(val));
  
      return 0;
  
  }
  </code></pre>
  <p>I get  output as String value = MODE0_SENSE, Int value = 0</p>
  <p>I would like to get: String value = MODE0_SENSE, Int value = 9</p>
  <p>What is wrong in the code and how to fix?</p>