title: What's the effect of casting integer reference value to (const char*) and what's the difference between cast to char* and cast to const char* in c++?
body: <p>I'm reading some codes where sometimes casting integer reference value to const char * used with ostream is happened.</p>
  
  <pre><code>uint32_t val;// initialized by some value
  void a(ostream&amp; os) const{
       os.write((const char*)&amp;val, sizeof(val));
  }
  </code></pre>
  
  <p>1) What's the effect of casting integer reference type to (const char*)??</p>
  
  <p>2) and is it same to use  (char *)&amp;val as to use (const char *)??</p>
  
  <p>2*) If not, what's the difference??</p>