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

What is the density of helium at 0.975 atm and 27.0 C?
(-14,-13), (-7,-7) Can anyone help me solve this - algebra
Explain how you use a net to find the surface area of a prism?
Enter a positive value for d that makes this statement true: 18 *d less than 18 but greater than 0
What is the median pumpkin weight?
find the slope of (0,-1) (3,5)
If a school wanted to seek funding for ecofriendly technologies for their school, which of the following reports would be most useful for them to provide on the
The study of normal tissues, or groups of cells and their surrounding extracellular materials, is called.
Science questions about pure substances and mixtures
Calculate the turnover of gold rings sold in the south african market annually. demonstrate your approach to getting to an answer