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

Which organism most likely has 0.01% of the Sun's energy available for its use?
120 grams of calcium nitrite Ca(NO2)2 is dissolved in a 240 mL solution. What is the molarity of the solution???Help?!?!
what is the molarity of a solution that contains 15.0g of naoh per 500.0 ml of solution ​
markin brainiest !!!
Can somebody help me
1. What are some of the ways that investigators try to determine time of death?
Identify any two sporting codes that you know have been used to forge integration and unity in communities characterised by conflict and inequalities. Provide e
Which sentence in this excerpt from John Lewis's Walking With the Wind: A Memoir of the Movement shows that the author was influenced by Henry David Thoreau?As
The hormone epinephrine is released into the blood and travels to the lungs where it increases function. Which organ systems are involved in this scenario? circ
How much cheese did Serena use for sandwiches