Guest_imported
New member
- Jan 1, 1970
- 0
Im a beginner in c++ and i can set this code to work:
#include "stdio.h"
#include "dos.h"
void main(void)
{
unsigned int far *ptraddr; /* Pointer to location of Port Addresses */
unsigned int address; /* Address of Port */
int a;
ptraddr=(unsigned int far *)0x00000408;
for (a = 0; a < 3; a++)
{
address = *ptraddr;
if (address == 0)
printf("No port found for LPT%d \n",a+1);
else
printf("Address assigned to LPT%d is %Xh\n",a+1,address);
*ptraddr++;
}
}
a)is this code compatible with microsoft c
b)i make a new project console win32 application and i put this source in a .cpp file and *.*.h files in the header directory. what else do i have to do everytime it writes me that it can not recognise the "far" thing that is mentioned in the source above.
#include "stdio.h"
#include "dos.h"
void main(void)
{
unsigned int far *ptraddr; /* Pointer to location of Port Addresses */
unsigned int address; /* Address of Port */
int a;
ptraddr=(unsigned int far *)0x00000408;
for (a = 0; a < 3; a++)
{
address = *ptraddr;
if (address == 0)
printf("No port found for LPT%d \n",a+1);
else
printf("Address assigned to LPT%d is %Xh\n",a+1,address);
*ptraddr++;
}
}
a)is this code compatible with microsoft c
b)i make a new project console win32 application and i put this source in a .cpp file and *.*.h files in the header directory. what else do i have to do everytime it writes me that it can not recognise the "far" thing that is mentioned in the source above.