Home Products Download Order Contacts

comp.graphics.algorithms

Subject: Re: Help with blit bug!



Here's a neat trick to test your device's endianness, assuming you know
that it is either little or big.

#include
#include

using namespace std;

int main()
{
char test[sizeof(int)] = {1};
int testInt = *((int*)test);
if (testInt == 1)
{
cout << "Your computer is little endian." << endl;
}
else
{
cout << "Your computer is big endian." << endl;
}

string tmp;
getline(cin, tmp);

return 0;
}

--
Kalle Rutanen
http://kaba.hilvi.org

Reply


View All Messages in comp.graphics.algorithms

path:
Help with blit bug! =>Re: Help with blit bug! =>Re: Help with blit bug! =>

Replies:
Re: Help with blit bug!

Copyright 2006 WatermarkFactory.com. All Rights Reserved.