Levels Tought:
University
Teaching Since: | Apr 2017 |
Last Sign in: | 347 Weeks Ago, 4 Days Ago |
Questions Answered: | 9562 |
Tutorials Posted: | 9559 |
bachelor in business administration
Polytechnic State University Sanluis
Jan-2006 - Nov-2010
CPA
Polytechnic State University
Jan-2012 - Nov-2016
Professor
Harvard Square Academy (HS2)
Mar-2012 - Present
QUESTION: Write a function to check if a machine uses little endian or big endian notation.
The basic structure of the program is given. You are expected to write the function checkEndianess(), complete the main function implementation to print the value returned by the function and print if the machine is A????1Little EndianA????1 or A????1Big EndianA????1, compile and run the program.
The function checkEndianess() should return the following values:
A????1 0 if the architecture is "Little Endian"
A????1 1 if the architecture is "Big Endian".
#include
int main() {
int check; // Variable: "check" will hold the value returned by the function
//Call the function to check the Endianness here check = checkEndianess ();
// Write the code to check the value returned by the function // print if the system uses little Endian or big Endian notation
return(0); }
/* Function "checkEndianess" checks the Endianness of the machine on which this program is executed. It takes an integer value as input and returns an
integer value.
The function should return 0 if the architecture is "Little Endian" and return 1 if the architecture is "Big Endian".
*/
int checkEndianess () {
}
KEY POINTS:
Make sure to call the function name correctly (same function name as given in this document) in the main program.
Comment out all non-C statements.
Follow all instructions mentioned above.
-----------