title: C++ difference between unsigned int and unsigned long int
body: <p>I am doing C++ development on Windows with Visual Studio Compiler, specifically Visual Studio 2015 Update 3.</p>
  
  <p>For some DSP related work I am using <strong>unsigned int</strong>/<strong>unsigned long</strong> data type. I was wondering what is the difference between these two built in C/C++ type. </p>
  
  <p>I searched through Google and SO for a little bit and found these references.</p>
  
  <ol>
  <li><a href="http://en.cppreference.com/w/cpp/language/types" rel="nofollow noreferrer">Types documentation</a> on cppreference.com</li>
  <li><a href="https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx" rel="nofollow noreferrer">Types documentation</a> on MSDN for Visual Studio 2015</li>
  <li><a href="https://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html#Integer-Types" rel="nofollow noreferrer">Types documentation</a> for GNU C/C++ (as <a href="https://gcc.gnu.org/onlinedocs/libstdc++/manual/support.html#std.support.types.fundamental" rel="nofollow noreferrer">G++ compiler</a> stated that C/C++ use same default type implementation, I refer to C doc here)</li>
  </ol>
  
  <p>I assume the cppreference documentation is the summarize for ISO C++11 standard. So from the "standard" <strong>unsigned</strong> and <strong>unsigned int</strong> are 16/32 bits depending on LP/ILP 32/64 data model while <strong>unsigned long</strong> and <strong>unsigned long int</strong> are 32/64 bits depending on LP/ILP 32/64 data model.</p>
  
  <p>For MSDN and GNU documentation they all stated that <strong>unsigned int</strong>/<strong>unsigned long</strong> are using 32 bits implementation and can hold value up to 4,294,967,295. However GNU documentation also stated that according to your system unsigned long could be 64 bits where it is the same as unsigned long long int.</p>
  
  <p>So my question are as follows: </p>
  
  <ol>
  <li>For unsigned long 64 bits, is going beyond ceiling 4,294,967,295 an undefined behavior or correct behavior? </li>
  <li>If I have an application working on Windows system compiled in Visual Studio, basicall <strong>unsigned</strong> == <strong>unsigned long</strong>. True or False?</li>
  <li>If I have an application compiled by GNU compiler working on Linux/Windows I have to make sure whether <strong>unsigned long</strong> == <strong>unsigned int</strong> or <strong>unsigned long</strong> == <strong>unsigned long long</strong> to avoid data overflow. True or False</li>
  <li>If I have a cross platform application that might be compiled by all of these Visual Studio/GNU/Clang/Intel compiler I have to clearly classify the environment with bunch of preprocessors to avoid data overflow. True or False</li>
  </ol>
  
  <p>Thanks in advance.</p>
  
  <p><strong>Edit:</strong>
  Thanks for @PeterRuderman pointing out that going beyond ceil value for unsigned type is not undefined behavior.</p>
  
  <p>Then my question 1 will change to:</p>
  
  <ol>
  <li>For unsigned long 64 bits, will going beyond ceiling 4,294,967,295 cause itself to wrap around?</li>
  </ol>