logo

CuriousTab

CuriousTab

Discussion


Home Technical Questions Programming Comments

  • Question
  • How would you obtain segment and offset addresses from a far address of a memory location?


  • Correct Answer
  • #include "dosh" main() { Char far *scr = ( char far *) 0xB8000000; Char *seg, *off; Seg = (char *) FP_SEG ( scr ); Off = ( char *) FP_OFF ( scr ); } 


  • Programming problems


    Search Results


    • 1. Methods declared as what cannot be overriden?

    • Options
    • A. Transcient
    • B. Abstract
    • C. Final
    • D. Super
    • Discuss
    • 2. Which of the following is true?

    • Options
    • A. It is appropriate to use assertions to validate arguments to methods marked public
    • B. It is appropriate to catch and handle assertion errors
    • C. It is NOT appropriate to use assertions to validate command-line arguments
    • D. None
    • Discuss
    • 3. What is the output of this C code? #include void main() { int x = 97; char y = x; printf("%cn", y); }

    • Options
    • A. a
    • B. 97
    • C. Run time error
    • D. None
    • Discuss
    • 4. What is math.floor(3.6)?

    • Options
    • A. 6
    • B. 3
    • C. 3.5
    • D. 0.6
    • Discuss
    • 5. Two main measures for the efficiency of an algorithm are

    • Options
    • A. Time and Space
    • B. Complexity and Memory
    • C. Data and Space
    • D. Memory and Processor
    • Discuss
    • 6. What would be the output of the following program, if the array beigns at address 65486? main() { int arr[] = {12,14,15,23,45}; printf ("%u %u", arr, &arr); }
    • Discuss
    • 7. Would the following program compile? main() { int a = 10, *j; void *k; J = k = &a; J++; k++; printf ("\n%u %u", j, k); }
    • Discuss
    • 8. How would you eliminate the warning generated on complaining the following program? main() { char far *scr; scr = 0xB8000000; *scr = 'A'; }
    • Discuss
    • 9. What would be the output of the following program? main() { char ch ='A'; printf ("%d%d", sizeof (ch), sizeof ('A')); }
    • Discuss
    • 10. Point out the error, ifany, in the followingb code? typedef struct { int data; NODEPTR link; } *NODEPTR;
    • Discuss


    Comments

    There are no comments.

Enter a new Comment