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

plz help me Explain 3 basic beliefs of Hinduism that the text talks about. Page 5 and 6 talk about specific Hindu beliefs and page 7 has a review of these belie
6.) Solve for x : 7.) solve for Z: 3/4z + 2=8
PLEASE HELP!!!! Counter urbanization mostly occurs as a result of increasing demand for agriculture and farming. people’s desire for greater calm and isolation.
Suppose a car travels 174 miles in 3 ours. How far will it travel in 6 hours?
Which of these literary elements is typical of poetry? A. lines and stanzas B. repetition of words and phrases C. sentence structures that break the rules, such
Caan someone help me answer this!!!
Batch Co. employs knowledge workers and is finding that its employees are retiring closer to age 75 than to age 65. As a result, they recently amended their def
True or False: Ned had been in war/fighting for 2 years O True O False True or False EDR died in April of 1945 *
Solve for y -8y + 3 = 35
Refer back to the ROI formula. Even if there were no parenthesis around the numerator (today's price - your price), explain why you would still carry out that s