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

A student must take one physics, one chemistry, and one mathematics course during their junior year of high school. There are three courses to choose from for p
The existence of extensive scalded skin syndrome does not indicate that staphylococcus is growing in all the affected areas. why not?
What were the 3 view points about slavery in the west?
In the 1960 presidential campaign richard nixon faced charges of national corruption ch 29 a. True b. False
What term did salvador dalí invent that describes the foundation for his paintings?
Which statement is the correct interpretation of the inequality –2 > –8? On a number line, −2 is located to the right of –8. On a number line, −2 is located
How to find the x-intercept of of y+12=3(x-9)?
Jake got the expression 7x plus 1 and then wrote his answer as 1 plus 7x. Is his answer an equivalent expression? How do you know?
Keith has $500 in a savings account at the beginning of the summer. he wants to have at least $200 at the end of summer z he withdraws 25 per week for food clo
How would I graph and solve this inequality?? Help please! Press question to view image.