answersLogoWhite

0

There are n no. of ways for determining endianness of your machine. Here is one quick way of doing the same.#include <stdio.h>

int main()

{

unsigned int i = 1;

char *c = (char*)&i;

if (*c)

printf("Little endian");

else

printf("Big endian");

getchar();

return 0;

}

In the above program, a character pointer c is pointing to an integer i. Since size of character is 1 byte when the character pointer is de-referenced it will contain only first byte of integer. If machine is little endian then *c will be 1 (because last byte is stored first) and if machine is big endian then *c will be 0.

User Avatar

Wiki User

13y ago

What else can I help you with?

Continue Learning about Engineering

What is Endian formats?

Endian formats refer to the order in which bytes are arranged within larger data types, such as integers or floating-point numbers, in computer memory. There are two main types: big-endian, where the most significant byte is stored first, and little-endian, where the least significant byte is stored first. The choice of endian format can affect data interpretation, especially in systems that communicate with each other using different byte orders. Understanding endian formats is crucial in programming, networking, and data serialization.


What is the use of little endian and big endian?

"Little Endian" means that the lower-order byte of the number is stored in memory at the lowest address, and the high-order byte at the highest address. For example, a 4 byte Integer Byte3 Byte2 Byte1 Byte0 will be arranged in memory as follows: Base Address+0 Byte0 Base Address+1 Byte1 Base Address+2 Byte2 Base Address+3 Byte3 Intel processors (those used in PC's) use "Little Endian" byte order. "Big Endian" means that the high-order byte of the number is stored in memory at the lowest address, and the low-order byte at the highest address. The same 4 byte integer would be stored as: Base Address+0 Byte3 Base Address+1 Byte2 Base Address+2 Byte1 Base Address+3 Byte0 Motorola processors (those used in Mac's) use "Big Endian" byte order.


Why did so many formats of word processors develop?

Different companies competed in the word processor market, each trying to get a share of the market. They didn't agree on a specific format, so basically, every one came up with their won formats. Generic formats - such as RTF were introduced eventually, but nary a word processor uses that as its native format. Instead, they find it more convenient to use their own respective formats.


What is meant by high level language in IT?

The processor can basically understand instructions only in binary format. However for the programmer it would be difficult to write the complete source code in binary( 0 and 1) format and also it is more susceptible to error. To solve this problem of the programming world, certain languages were introduced that could be written in English like language for the ease of developer and later with the use of compiler it could be converted into machine level language(binary format). These kind of languages are called as high level languages. example: Java, C# etc


What is the benefit osf saving a file text format HTML format and csv format?

The primary benefit of saving a file in HTML format is that you can view it in a web browser. Files should be saved in a format that is compatible with the application using the file.

Related Questions

What is Endian formats?

Endian formats refer to the order in which bytes are arranged within larger data types, such as integers or floating-point numbers, in computer memory. There are two main types: big-endian, where the most significant byte is stored first, and little-endian, where the least significant byte is stored first. The choice of endian format can affect data interpretation, especially in systems that communicate with each other using different byte orders. Understanding endian formats is crucial in programming, networking, and data serialization.


What is the format of the integer when held in the PC?

There is no single format. Different architectures and platforms store data in different ways. An integer's representation depends on its length (in bytes), the byte-order (little-endian or big-endian) and whether they are signed or unsigned. If signed, they may be represented using either ones-complement or (more commonly) twos-complement. Most programming languages provide several integer types, however the actual representation of each of these types is machine-dependent and, therefore, implementation-dependent, even in the same language.


What type word processor do you use in a legal organization?

You can use any word processor you like as long as you legally pay for the right to do so. Open Office is free for private people but may not cost you a fortune if you decide to use it in an organization. Most people all over the world can today use the format DOC as in Microsoft Word. Most new software can convert to and from this format.


What is the rtf format?

RTF (Rich Text Format) is a standard language for formatting printed pages, such as word processor documents. RTF can be used as a "Bridge" between programs; for example if you have Microsoft Word and another word processor, and you wish to open a document in the other word processor, you could save the document as an RTF document in Microsoft word, then open the RTF document in the other word processor.


What is the use of little endian and big endian?

"Little Endian" means that the lower-order byte of the number is stored in memory at the lowest address, and the high-order byte at the highest address. For example, a 4 byte Integer Byte3 Byte2 Byte1 Byte0 will be arranged in memory as follows: Base Address+0 Byte0 Base Address+1 Byte1 Base Address+2 Byte2 Base Address+3 Byte3 Intel processors (those used in PC's) use "Little Endian" byte order. "Big Endian" means that the high-order byte of the number is stored in memory at the lowest address, and the low-order byte at the highest address. The same 4 byte integer would be stored as: Base Address+0 Byte3 Base Address+1 Byte2 Base Address+2 Byte1 Base Address+3 Byte0 Motorola processors (those used in Mac's) use "Big Endian" byte order.


How do I make a picture into a PEG format?

The simplest way to change a file format is to save a copy in the new format. Don't lose the original in case the change does not work or gives a file unreadable on your image-processor!


How can I use the Photoshop Image Processor to convert multiple images into PNG format?

To convert multiple images into PNG format using the Photoshop Image Processor, follow these steps: Open Photoshop and go to File Scripts Image Processor. Select the images you want to convert by clicking &quot;Select Folder&quot; or &quot;Select Folder&quot; and choosing the images. Choose the destination folder where you want the converted images to be saved. Select PNG as the file format under &quot;File Type.&quot; Adjust any additional settings, such as resizing or quality, if needed. Click &quot;Run&quot; to start the conversion process. This will batch convert your selected images into PNG format using the Photoshop Image Processor.


How can I use Photoshop's Image Processor to convert multiple images to the PNG format?

To convert multiple images to PNG format using Photoshop's Image Processor, follow these steps: Open Photoshop and go to File Scripts Image Processor. Select the images you want to convert by clicking &quot;Select Folder&quot; or &quot;Select Folder&quot; and choose the output location. Choose PNG as the file format in the &quot;File Type&quot; dropdown menu. Adjust any other settings as needed, such as resizing or quality. Click &quot;Run&quot; to start the conversion process.


How can I batch convert raw images to JPEG format using Photoshop?

To batch convert raw images to JPEG format using Photoshop, you can use the &quot;Image Processor&quot; tool. Simply go to File Scripts Image Processor, select the raw images you want to convert, choose JPEG as the output format, and specify the destination folder. Click &quot;Run&quot; to start the batch conversion process.


Is a PDF a word processer?

No it is not a word processor, it is a file format, that is supposed to be good for printing. Also, you cant edit a pdf after it is made.


What can you do on word processor?

we can use word processor to compose, format, sort and rearrange text upon command and sometimes perform other related functions such as correcting misspelled words.we can also create personalized computer letters.


VDU an output device What does it do?

VDU (Visual Display Unit) displays output results of the processing done by the Processor in Human Readable Format.