title: Is there any way to access data of one C pointer from another C program
body: <p>I have two programs,</p>
  
  <p>Program A is like this,</p>
  
  <pre><code>int main(int argc, char** argv) {
  
      char* s = "hello";
  
      printf(s);
  
      return (EXIT_SUCCESS);
  }
  </code></pre>
  
  <p>The base address of s is 0x80484e0 "hello", Now I have Program B, as below</p>
  
  <pre><code>int main(int argc, char** argv) {
  
      void* p = (void*)0x80484e0;
  
      char* c = (char*)p;
  
      while(*c)
      {
          printf("%c",*c);
          c++;
      }
  
      return (EXIT_SUCCESS);
  }
  </code></pre>
  
  <p>In program B 'p' is pointing to the same base address as 's' in Program B but the contents are not same.</p>
  
  <p>Even though 'p' and 's' are having same base address their contents are not same, is it because they are running as different programs in different address space?</p>