title: Structure definition in header file for a library and compilation differences
body: <p>I have a code which is compiled into a library (dll, static library and so). I want the user of this library to use some struct to pass some data as parameters for the library function. I thought about declaring the struct in the API header file. </p>
  
  <ul>
  <li>Is it safe to do so, considering compilation with different compilers, with respect to structure alignment or other things I didn't think about?</li>
  <li>Will it require the usage of the same compiler (and flags) for both the library and its user?</li>
  </ul>
  
  <p>Few notes:</p>
  
  <ol>
  <li>I considered giving the user a pointer and set all the struct via functions in the library, but this will make the API really not comfortable to use.</li>
  <li>This question is about <strong>C</strong>, although it would be nice to know if there's a difference in c++. </li>
  </ol>