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

Number 6 and 7. Is giving me a little hard time can you help?
A rectangle is 20 meters long and 20 meters wide. If the length is increased by 10% and the width is decreased by 10%, what is the new area?
A baseball pitcher won 85 % of the games he pitched. If he pitched 40 ballgames , how many games did he win ?
If a car in 3 hours travels 156 miles, what is the speed of the car in miles per hour?
Write the coordinates of the vertices after a reflection over the x-axis.-10-8-6-4-2246810-10-8-6-4-2246810xyDEFG
1. Determine whether (3,7) is a solution of the system of equations. -5x - 2y = 23 x + 4y = -19
number 1 in the diagram above is a representation of a/an
Write an equivalent expression for (x+2)+(x+2)
Suppose our school library is moving to a new building on campus and the librarian has asked for your help. What approach would you take if you just needed to c
Please look at the image below. This is my homework by the way.The figure shown are congruent. Find a sequence of transformations for the indicated mapping. Giv