Hello again all,
I have some values stored in a Class Object that I would like to print to the screen. Unfortunately I only seem to be able to find ways of printing strings to the screen. Is there any way of getting values to print? I should point out that i'm using MFC, i realise in c++ its easy to just write cout << value1. Help, as always, is greatly appreciated.
Incidently below is the code for my object. The values I would like to print out are:
int m_Cost;
int m_Penalty;
int m_Length;
int m_LineCrosses;
These will be printed out in the OnDraw function. e.g.
FunctionToPrintValues(x,y,CLine1.m_cost)
Code:class CLine { public: int m_Cost; int m_Penalty; int m_Length; int m_LineCrosses; int m_XYCoOrds[10][2]; int m_DrawCoOrds[10][2]; //function definitions void RandomCoOrd(void);// set the genes void DrawLine(CDC* pDC) const;//draw the line int SectionLength(int m_XYCoOrds[][2]);//returns length of section int ncrosses(int m_XYCoOrds[][2]);//gets the number of lines crossed CLine(); virtual ~CLine(); };



LinkBack URL
About LinkBacks


