|
I want to design two buttons, one for calculation and one for save
I want to achieve this:
Define a class,
Two class member functions in the class define a pointer. Because the memory size pointed to by the pointer is not fixed, the application for memory must be placed in one of the member functions, but the operation result must be saved in the other function.
Is the process of implementing operations in one member function and saving the results with another member function
How to achieve?
E.g
class a
{
public:
float * f;
a :: fun1 ();
a :: fun2 ();
};
a :: fun1 ()
{
f = new float [10];
...
Operation
...
}
a :: fun2 ()
{
CFile file;
file.open (filename, CFile :: modeCreate | modeWrite);
file.write (f, 10 * 4);
} |
|