473,396 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to implement a program to determine the endianness of a machine?

How to implement a program to determine the endianness of a machine and explanation of the code?
Jan 19 '11 #1
1 1530
horace1
1,510 Expert 1GB
you could use a union of int and unsigned chars, have alook at
http://www.codeproject.com/KB/cpp/endianness.aspx
Jan 19 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Nidhee Pathak via .NET 247 | last post by:
Hi, I am trying to run an exe present on the remote machine using the ManagementClass object. I connect to the remote machine using ObjectManagementScope class, but i am not being able to run the...
3
by: Robin Tucker | last post by:
I'm fetching a list of SQL servers on a domain using a function that returns strings, including "(local)" for the local machine (if it has an SQL server on it). Now, presumably in a different...
18
by: friend.05 | last post by:
Code to check endianness of machine
21
by: codergem | last post by:
One common answer is that all compilers keep the size of integer the same as the size of the register on a particular architecture. Thus, to know whether the machine is 32 bit or 64 bit, just see...
18
by: Indian.croesus | last post by:
Hi, If I am right Endianness is CPU related. I do not know if the question is right in itself but if it is then how does C handle issues arising out of Endianness. I understand that if we pass...
2
myusernotyours
by: myusernotyours | last post by:
hi all, I'd like to know whether it's possible to compile a java program into actual machine code so that the program runs without the need for the Java Runtime. If it's possible how can it be done?...
19
by: perry.yuan | last post by:
How could I determine the endianness of my compile environment at compile time, instead of run time? I need a macro ("some_expression"), i.e. #if some_expression #define TARGET_IS_LITTLE_ENDIAN...
8
by: id10t error | last post by:
Hi, I am sorry that my description is not better but it is hard to think of one for this problem. I have a program on the user computer and I need to only let them have one instants of this...
0
by: luvdiamondz | last post by:
I kno this is a lot to ask ffor, but i am desperate at the moment... i was sick for 2 weeks only 2 come back 2 skool and be told that the program is due for 2morrow! i missed all the classes teaching...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.