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

The four fundamental forces that operate in the universe today are
The answer please anyone???
The networking organization you joined is throwing a party. You are in charge of buying the chips, which cost $2.50 per bag and salsa, which costs $4 per jar. T
An/a_____ solution with a ph of 9.82 has a hydroxide concentration of______M. A. Basic,1.51x10^-10 B. Neutral,1.51x10^10 C. Basic,6.61x10^-5 D. Acidic,6.61x10^-
Bob mixed 5 mg of sodium hydroxide pellets in 100 mL of water. Describe how the rate of the solution changes when he adds 1 mg more of sodium hydroxide pellets.
What cloud application offers a variety of cloud services, including automation and crm, cloud application development, and web site marketing?​?
Will an email sent from a phone say it was sent from your phone
a _ can be used in the senate to stop a bill from being passed
How did World War One effect South Asia in the 1930’s?
A woman with blood type a b has a daughter with blood type a based on blood type alone which of the following men is the possible father