compiler error in visual C++ - TechRepublic
General discussion
December 5, 2002 at 09:32 PM
adel_ibrahim

compiler error in visual C++

by adel_ibrahim . Updated 23 years, 5 months ago

#include
#include
#include
#include

#define LPT1 0x00400008
#define LPT2 0x0040000a
#define LPT3 0x0040000c
#define LPT4 0x0040000e

int main(int argc, char *argv[])
{
unsigned int port,data;unsigned int *bios_printer_addr;

if (argc>3) exit(1);
switch(argc)
{
case 1:
exit(1);

case 2:
port=*(bios_printer_addr=LPT1);

if (port==NULL)
{
printf(“LPT1 does not exist\n”);
exit(1);
}
sscanf(argv[1],”%x”,&data);
break;

case 3:
if (argv[1][0]==’/’)

switch(argv[1][1])
{
case ‘1’:
port=*(bios_printer_addr=LPT1);
if (port==NULL)
{
printf(“LPT1 does not exist\n”);
exit(1);
}
sscanf(argv[2],”%x”,&data);
break;

case ‘2’:
port=*(bios_printer_addr=LPT2);
if (port==NULL)
{
printf(“LPT2 does not exist\n”);
exit(1);
}
sscanf(argv[2],”%x”,&data);
break;

case ‘3’:
port=*(bios_printer_addr=LPT3);
if (port==NULL)
{
printf(“LPT3 does not exist\n”); exit(1);
}
sscanf(argv[2],”%x”,&data);
break;

case ‘4’:
port=*(bios_printer_addr=LPT4);
if (port==NULL)
{
printf(“LPT4 does not exist\n”);
exit(1); }
sscanf(argv[2],”%x”,&data);
break;

default:
printf(“Invalid printer port!\n”);
exit(1);
}

else exit(1);
}

int _outp(port,data);
return 0;
}

when I comile thiscod I got the error:
(C:\3074_dos\RELAY.C(92) : error C2143: syntax error: missing ‘;’ before ‘type’).
This line contained this code(int _outp(port,data);)

This discussion is locked

All Comments