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

If √5 - x = 4,then x=i need help on here how to solve it
All of the following added to the growing tension between the North and the South EXCEPT A) Uncle Tom s Cabin B) Plessy v. Ferguson C) raid on Harper s Ferry D)
After Pennsylvania experienced its oil boom in 1859, three other states discovered vast oil reserves. Name two of these states.
let f(x)=3x-6 and g(x)=x-2. find the g/f and state its domain.
how can I solve this equation.
Walt made an extra $7000 last year from a part-time job. He invested part of the money at 10% and the rest at 7%. He made a total of $580 in interest. How much
How do you make profit when you open a business
1. Juan bought a pair of shoes costing P923.00 and a tie costing P275.00. He gave the seller P2, 000.00. How much change did he receive?
A box contains bags of crisps. Each bag of crisps weighs 25 grams. Altogether, the bags of crisps inside the box weigh 1 kilogram. How many bags of crisps are
6^x+8=17^2x-2 can I have help