title: C Duration of strings, constants, compound literals, and why not, the code itself
body: <p>I didn't remember where I read, that If I pass a string to a function like.
  <code><pre>
  char *string;
  string = func ("heyapple!");
  char *func (char *string) {
     char *p
     p = string;</p>
  
  <p>return p;
  }
  printf ("%s\n", string);
  </pre></code></p>
  
  <p>The string pointer continue to be valid because the "heyapple!" is in memory, it IS in the code the I wrote, so it never will be take off, right?</p>
  
  <p>And about constants like 1, 2.10, 'a'?</p>
  
  <p>And compound literals?</p>
  
  <p>like If I do it:
  <code><pre>func (1, 'a', "string");</code></pre></p>
  
  <p>Only the string will be all of my program execution, or the constans will be too?</p>
  
  <p>For example I learned that I can take the address of string doing it 
  <code><pre>&amp;"string";</code></pre></p>
  
  <p>Can I take the address of the constants literals? like 1, 2.10, 'a'?</p>
  
  <p>I'm passing theses to functions arguments and it need to have static duration like strings without the word static.</p>
  
  <p>Thanks a lot.</p>