FUNCTION
Is_Big_Endian
Returns true if the computer architecture is Big Endian, false otherwise.
Interface
#include <codecogs/computing/lowlevel/is_big_endian.h>
using namespace Computing::Lowlevel;
For more information about the computer architecture theory behind this algorithm, please visit: http://en.wikipedia.org/wiki/Endianness
Example 1
The following program displays whether the computer architecture is Big Endian or not (the opposite would most probably be Little Endian, but there are also other non-Big Endian architectures).
#include <iostream>
#include <codecogs/computing/lowlevel/is_big_endian.h>
using namespace std;
int main()
{
cout << "Computer architecture is ";
if (Computing::Lowlevel::isBigEndian()) cout << "Big Endian.";
else cout << "Little Endian (or other non-Big Endian).";
cout << endl;
return 0;
}Interactive Calculator
Result
Computing…
Set a range above first to export a graph.
This function's source code is only visible to registered users — documentation and the calculator above are free to use either way. Sign in to see it.