title: Printf for struct? (C/C++, VC2008)
body: <p>Just build&amp;run this in VC2008:</p>
  
  <pre><code>struct A
  {
     int a;
     int b;
     int c;
  };
  A a = { 10, 20, 30 };
  printf("%d %d %d\n", a);
  </code></pre>
  
  <p>Is it normal?</p>
  
  <pre><code>10 20 30
  </code></pre>
  
  <p>I'd like to cast! but it don't works:</p>
  
  <pre><code>struct A
  {
     int a;
     int b;
     int c;
     operator int()
     {
        return a + b + c;
     }
  };
  A a = { 10, 20, 30 };
  printf("%d\n", a);
  </code></pre>
  
  <p>output is only:</p>
  
  <pre><code>10
  </code></pre>
  
  <p>I need auto-casting for template-utility.
  Here it is: <a href="https://code.google.com/p/boolib/source/browse/boolib/crypt/ShakedValue.h" rel="nofollow">https://code.google.com/p/boolib/source/browse/boolib/crypt/ShakedValue.h</a>
  It should hide in memory value, that any hack-programms (ArtMoney) can't find value.</p>
  
  <p>And one more trick usage: <strong>Print private members of the struct/class</strong></p>