title: Can I pass a hexadecimal string as an address to a function in C?
body: <p>I tried to pass a hexa string as an address to a function as an argument. But I don't know what address I can legally access. So I used a variable and got its address in hope that I could know the address my process can work with. But it did not work. I got segmentation fault 11. Can anybody please explain me why?</p>
  <p>This is my code:</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  void print_something(char *s) {
      printf(&quot;I was here\n&quot;);
      while (*s) {
          printf(&quot;%c&quot;, *s);
          s++;
      }
      printf(&quot;\n&quot;);
  }
  
  int main() {
      char a = 48;
      printf(&quot;%p\n&quot;, &amp;a);
      print_something((char *) 0x7ffeec6a1b5b);
      return 0;
  }
  </code></pre>
  <p>And this is what I got when I executed it:</p>
  <pre><code>0x7ffee31ecb5b
  I was here
  Segmentation fault: 11
  </code></pre>