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

Question #5 Multiple Choice As an adult, you will never be given responsibilities. O False O True
Write an equation that demonstrates the identity property of multiplication. Your equation should include a fraction multiplied by a whole number that will resu
A campus shuttle bus makes 1 revolution per second round a circular track of radius 100 cm. Determine its periodic time. ​
Find the missing number so that the equation has no solutions. x – 5 = –3x + 8
how many more books would eric have to read to match the same number of books as mark?
4 9/10 X 1/4. {State your answer as a mixed number in simplest form.} State your answer as a mixed number in simplest form
Combine the sentences to form a compound complex sentence. He worked hard. He was paid well. He was satisfied.
Write the equation of the graph shown below in factored form. F(x) = (x - 1)^2(x - 1)(x + 3) Ofb) = (x - 1)^2(x + 1)(x - 3)
La nutria es un animal acuatico?
Whats is the explicit form for 27,18,12,8