Mail Archives: djgpp/2000/02/14/17:27:53
Hello,
I have the following question:
Is it possible to define far pointers in djgpp
as I have done in the following example with MSVC++?
And:
If so, which command line parameters do I have to
specify? (e.g.: gcc -v example.c -o example )
Thank you in advance. JSchumann
-----------------------------------------------------
#include <dos.h>
#include <malloc.h>
#include <stdio.h>
void main( void )
{
void far *p; /* define pointer */
unsigned int seg_val;
unsigned int off_val;
p = _fmalloc( 100 ); /* example for initialisation of p:
allocate memory */
seg_val = _FP_SEG( p ); /* get segment- and offset-address */
off_val = _FP_OFF( p );
printf("Pointer: %Fp\n" ,p);
printf("Segment: %.4X\n",seg_val);
printf("Offset : %.4X\n",off_val);
_ffree(p); /* free memory */
}
- Raw text -