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

how many hundreds are in 5000
Crossword puzzle question. Hint, "to provide shelter and food". Word ????T??
the ability of water molecules to cling to each other is referred to as (PICK ONE) a.store b.plants c.surface-tension d.temperature e.hydrogen f.adhesion
What country is Iraq in?
How did the rise of labor unions shape relations among workers, big business, and government?
A 50-ft cable is stretched from the top of an antenna to an anchor point on the ground 15ft. from the base of the antenna . How tall is the antenna?
Emily spent 1/2 of her money at the grocery store. Then, she spent 1/2 of what was left at the bakery. Next, she spent 1/2 of what was left Ina CD that was on s
which is an example of fact, not historical fiction? A. Marie Curie won a Nobel Prize for physics and a Nobel Prize for chemistry. B. A cool wind swirled around
By the time shana had completed 3/8 of her first lap in a race, she had also completed 1/32 of the entire race. How many laps were there in the race.
Who was the General in command of American forces during World War I? Allenby Pershing Mitchell