Practice Question and Answer

  • Show AnswerHide Answer
  • Workspace

Answer :
Explanation :

Use the typecast scr = (char far *) 0xB8000000;

Q: How would you obtain segment and offset addresses from a far address of a memory location? 2242 0

  • Show AnswerHide Answer
  • Workspace

Answer :
Explanation :

#include "dos.h" main() {     Char far *scr = ( char far *) 0xB8000000;     Char *seg, *off;     Seg = (char *) FP_SEG ( scr );     Off = ( char *) FP_OFF ( scr ); }

  • Show AnswerHide Answer
  • Workspace

Answer :
Explanation :

11  2  1   1

  • Show AnswerHide Answer
  • Workspace

Answer :
Explanation :

65486  65486

  • Show AnswerHide Answer
  • Workspace

Answer :
Explanation :

1   2

  • Show AnswerHide Answer
  • Workspace

Answer :
Explanation :

main() {    char *str[] = { "Frogs", "Do", "Not", "Die." , "They", "Croak!" };    int i;          for ( i = 0;i<=5;i++)          printf ("\n%s%d", str[i], strlen( str[i])); }

  • Show AnswerHide Answer
  • Workspace

Answer :
Explanation :

A typedef defines a new name for a type, and in simpler cases like the one shown below you can define a new structure type and a typedef for it at the same time. typedef struct {     char name[20];     int age; } emp; However, in the structure defined in this question, there is an error because a typedef declaration cannot be used until it is defined. In the given code fragment the typedef declaration is not yet defined at he point where the link field is declared.

  • Show AnswerHide Answer
  • Workspace

Answer :
Explanation :

No, since the structure contains a char pointer while writing the structure to the disk using fwrite() only the value stored in the pointer n would get written. When this structure is read back the address would be read back but it is quite unlikely that the desired string would be present at this address in memory

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully