Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does "union REGS reg;" mean 2

Status
Not open for further replies.

marcasii

Programmer
Aug 27, 2001
109
AU
Hi,

I am a C++ novice having worked with it for only a short while years ago. I now have been given a c++ file that runs a simple racing timing application (DOS based). I am trying to compile it now using Borland C++ compiler and get the error (plus many more but all relate to this one):

Error E2450 test.cpp 63: Undefined structure 'REGS'
Error E2450 test.cpp 63: Undefined structure 'REGS'

The line it refers to is simply:
union REGS reg;

I am unsure what union or reg is in C++

the command line I use to compile is:
bcc32 -Ld:\borland\bcc55\lib -Id:\borland\BCC55\include test.cpp

Any ideas why it is having a problem with this line?
 
REGS is a structure, e.g.,
Code:
struct REGS
{
    double One;
    int Two;
    string Three;
}

The error indicates that the structure isn't defined in your code. Did you forget to include a file?

James P. Cottingham

There's no place like 127.0.0.1.
There's no place like 127.0.0.1.
 
regs is usually a predefined structure to access the processor's registers. If you are adapting 16-bit code for a 32-bit environment it's nearly certain that the use the original programmer made of the processor's registers will not be acceptable in your new code. Unfortunately this is the sort of hardware-near thing that is often hard to translate unless you understand what it's doing.
 
Yeah that was it, I needed a 16bit compiler.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top