home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 13
/
mediashare_13.zip
/
mediashare_13
/
ZIPPED
/
PROGRAM
/
DDJ9403A.ZIP
/
XVCPP.ASC
< prev
Wrap
Text File
|
1994-01-30
|
2KB
|
150 lines
_CROSS-PLATFORM DEVELOPMENT WITH VISUAL C++_
by Chane Cullers
Figure 1
(a)
file.C, line 100: error: syntax error
(b)
int Number = 26;
unsigned char Letter;
...
Letter = unsigned char (Number);
(c)
Letter = (unsigned char)Number;
Figure 2:
(a)
file.C, line 100: error: WinCalApp::ExitInstance() type mismatch:
int WinCalApp::ExitInstance() and BOOL WinCalApp::ExitInstance()
(b)
BOOL WinCalApp::ExitInstance()
(c)
int WinCalApp::ExitInstance()
Figure 3:
(a)
file.C, line 100: error: jump past initializer (did you forget a '{ }'?)
(b)
default:
int Number = GetSomeNumber();
...
Doit(Number)
(c)
default:
{
int Number = GetSomeNumber();
...
Doit(Number)
}
Figure 4:
(a)
file.C, line 100: error: syntax error
(b)
DECLARE_DYNAMIC(ClassName);
(c)
DECLARE_DYNAMIC(ClassName)
Figure 5:
(a)
file.C: 100: Overflowed replacement buffer.
(b)
#define DEBUG_NEW new(__FILE__, __LINE__)
#if DEBUG
#define new DEBUG_NEW
#endif
CObject *obj = new CObject;
(c)
#define DEBUG_NEW new(__FILE__, __LINE__)
#if DEBUG
#define MYnew DEBUG_NEW
#else
#define MYnew new
#endif
CObject *obj = MYnew CObject;
Example 1:
typedef unsigned short WORD;
int function()
{
WORD wOne;
int nTwo;
...
nTwo = (WORD)wOne;
...
}
Example 2:
(a)
struct tagPOINT
{
short x;
short y;
};
class CPoint : tagPOINT {
...
CPoint::CPoint(DWORD);
...
};
CPoint::CPoint(DWORD dwPoint);
{
*(DWORD *)this = dwPoint;
}
(b)
CPoint::CPoint(DWORD dwPoint)
{
x=LOWORD(dwPoint);
y=HIWORD(dwPoint);
}