1. What i have to include for proper work with Linear Algebra package
interactively?
2. What can be the reason of the following message:
"Error in <TCanvas::x3d>: Failed to load OpenGL viewer". I got
opengl32.dll according
prescription.
3. The following C++ code don't work interactively and the result
depends upon the
order of function definitions. Why?
//-------------------------------------------------------------------------------------
#include <iostream.h>
external "C"
{
enum _BOOL { FALSE, TRUE };
typedef enum _BOOL BOOL;
}
void Swap (int&, int&);
void GetVals(int&, int&);
void Swap(int & rX, int & rY)
{
cout << "in Swap" << endl;
int temp;
temp = rX;
rX = rY;
rY = temp;
}
void GetVals (int & rx, int & ry)
{
cout << "in GetVals" << endl;
cout << "New value for x: " << endl;
cin >> rx;
cout << "New value for y: " << endl;
cin >> ry;
}
int main()
{
void (* pFunc) (int &, int &);
BOOL fQuit = FALSE;
int x=1, y=2;
int choice;
while (fQuit == FALSE)
{
cout << "(0)Quit (1)Change Values (2)Swap: " << endl;
cin >> choice;
switch ( choice) {
case 1: pFunc = GetVals;
cout << "choice: " << choice << " GetVals " << endl;
break;
case 2: pFunc = Swap;
cout << "choice: " << choice << " Swap " << endl;
break;
default: fQuit = TRUE;
break;
}
if (fQuit) break;
pFunc(x, y);
cout << "x= " << x << " y= " << y << endl;
}
return 0;
}
//-----------------------------------------------------------------------------------
Thank u.
Regards, Dorofeev.