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

Find the exact interest for $600 at 8% for 45 days. (Round to the nearest cent.) A. $6.36 B. $5.95 C. $6.00 D. $5.92
Overpopulation impacts the environment primarily because
What does the Code of Hammurabi contain? A. Texts that explain how to cast spells B. Rules and regulations for living in society C. Instructions for creating a
Which group of people worked to inform the public about injustices of the Progressive Era?
A burning candle is covered by a jar as shown in the picture. The whole arrangement has a mass of 500 g. What will be the approximate mass of the arrangement w
what does at most in inequality mean
The main role of women in Sparta was to learn how to read and write. prepare for government service. raise warriors and instill Spartan values. run their estate
Which on is bigger 7/8 or 5/6
whats992,449 rounded to the nearest hundred thousand
How is the information in news writing represented?a.Pyramid c.Outline b.Flowchart d.Inverted Pyramid