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 light we see coming from the moon is light from the sun. reflected refracted polarized diffracted
Jonah had $340.87 in his checking account. He deposited $53 and wrote a check for $38.72. Find his new balance. -How did Jonahs balance change after he deposit
An object with a mass of 5.6 g raises the level of water in a graduated cylinder from 25.1 mL to 33.9 mL. What is the density of the object?
SHWhat is the greatest common factor (GCF) of 35 and 28?​
Que significa para ti ser parte de la población hispana?
At noon, the temperature in Deliberate, Texas was 29°F. By midnight, the temperature had fallen to -11°F. What was the change in temperature over the 12-hour pe
Convert these improper fractions to mixed numbers 74 over 3 please help
The sum of two consecutive integers is -207
find the quotient. (5x^4 -3x^2+4)÷ (x+1)please hurry ​
39 is 197 divided by j