MagicDragon888 MagicDragon888
  • 21-12-2018
  • Computers and Technology
contestada

Write a program that checks the initial value in memory location x4000 to see if it is a valid ascii code and if it is a valid ascii code,

Respuesta :

tonb
tonb tonb
  • 21-12-2018

You must dereference it as an unsigned char* to get a byte, then check if it is in the valid ASCII range of 32-127.


void *ptr = 0x4000;

unsigned char c = *(unsigned char*)ptr;

if ((c>=32) && (c<=127))

{

 // Valid ascii

}

else

{

  // Not ascii

}

Answer Link

Otras preguntas

Which of the following is a device designed to open an overloaded circuit and prevent overheating? a. circuit breaker b. conductor c. resistor d. insulator
what is the solution of 2p-14=4(p+5)
name three types of foliated metamorphic rocks
why is the axis important for seasons?(I still hate asking this stuff in the Biology section)
What is the ratio for 3.5 to 8
What was the Mayflower Compact? a.the ship that transported the Pilgrims to America b.the colonial legislature of Virginia c.the agreement in which the Pilgrims
sandra lives 14 miles away from her workplace how many miles does she drive to and from work in five days
there are 15 trumpets and 9 trombones find the ratio of trombones and trumpets
Why is it so difficult to get aid to the people impacted by the cyclone in burma?
States that wanted a more democratic form of government with greater representation for the common people favored _____. A) no governor B) a unicameral legisl