Click here to Skip to main content
15,918,742 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerFor Now, I changed the way I created the thread. It works and looks clean Pin
jkirkerx21-Apr-12 12:33
professionaljkirkerx21-Apr-12 12:33 
QuestionC++ File Pin
Member 874742521-Apr-12 1:04
Member 874742521-Apr-12 1:04 
AnswerRe: C++ File Pin
Wes Aday21-Apr-12 1:15
professionalWes Aday21-Apr-12 1:15 
AnswerRe: C++ File Pin
Lakamraju Raghuram21-Apr-12 1:16
Lakamraju Raghuram21-Apr-12 1:16 
AnswerRe: C++ File Pin
CPallini21-Apr-12 8:25
mveCPallini21-Apr-12 8:25 
JokeRe: C++ File Pin
Nelek21-Apr-12 14:15
protectorNelek21-Apr-12 14:15 
GeneralRe: C++ File Pin
CPallini21-Apr-12 19:06
mveCPallini21-Apr-12 19:06 
QuestionRe: C++ File Pin
David Crow21-Apr-12 16:27
David Crow21-Apr-12 16:27 
QuestionMove screen to Secondary Monitor Pin
manju 321-Apr-12 0:01
manju 321-Apr-12 0:01 
AnswerRe: Move screen to Secondary Monitor Pin
Nelek21-Apr-12 14:13
protectorNelek21-Apr-12 14:13 
QuestionVC++ 6.0 MFC - Temp disable mouse and keyboard for 5 secs. Pin
rolfhorror19-Apr-12 21:29
rolfhorror19-Apr-12 21:29 
AnswerRe: VC++ 6.0 MFC - Temp disable mouse and keyboard for 5 secs. Pin
Resmi Anna19-Apr-12 22:55
Resmi Anna19-Apr-12 22:55 
GeneralRe: VC++ 6.0 MFC - Temp disable mouse and keyboard for 5 secs. Pin
rolfhorror20-Apr-12 8:12
rolfhorror20-Apr-12 8:12 
QuestionHow to let client using [i][j] access two dimension array? Pin
fantasy121519-Apr-12 14:28
fantasy121519-Apr-12 14:28 
AnswerRe: How to let client using [i][j] access two dimension array? Pin
Mohibur Rashid19-Apr-12 16:34
professionalMohibur Rashid19-Apr-12 16:34 
AnswerRe: How to let client using [i][j] access two dimension array? Pin
Lakamraju Raghuram19-Apr-12 18:00
Lakamraju Raghuram19-Apr-12 18:00 
I have tried it in this way:

C++
#include <iostream>

#include <vector>
#include <string>
using namespace std;

class CMyResultSet 
{
public:
	CMyResultSet(){}
	~CMyResultSet(){}

	string GetResult(unsigned int i, unsigned int j)
	{
		return m_Data[i][j];
	}

	void SetResult(string Result, unsigned int i)
	{
		if( i >= m_Data.size())
		{
			// New push to 1-dimension
			vector<string> vec;
			vec.push_back(Result);
			m_Data.push_back(vec);
		}
		else
		{
			// Push to an existing 1-dimension's 2nd dimension
			m_Data[i].push_back(Result);
		}
	}

private:

	vector< vector<string> > m_Data;

};

void main()
{
	CMyResultSet objResultSet;
	
	objResultSet.SetResult("00",0);
	objResultSet.SetResult("01",0);
	
	objResultSet.SetResult("10",1);
	objResultSet.SetResult("11",1);
	
	objResultSet.SetResult("20",2);

	cout<<"Value at 00:"<<objResultSet.GetResult(0,0)<<endl;
	cout<<"Value at 01:"<<objResultSet.GetResult(0,1)<<endl;
	cout<<"Value at 10:"<<objResultSet.GetResult(1,0)<<endl;
	cout<<"Value at 11:"<<objResultSet.GetResult(1,1)<<endl;
	cout<<"Value at 20:"<<objResultSet.GetResult(2,0)<<endl;

}

AnswerRe: How to let client using [i][j] access two dimension array? Pin
Erudite_Eric19-Apr-12 20:57
Erudite_Eric19-Apr-12 20:57 
AnswerRe: How to let client using [i][j] access two dimension array? Pin
Aescleal20-Apr-12 3:05
Aescleal20-Apr-12 3:05 
QuestionOwner Drawn button does not get messages Pin
cpp_prgmer19-Apr-12 11:33
cpp_prgmer19-Apr-12 11:33 
SuggestionRe: Owner Drawn button does not get messages Pin
Mohibur Rashid19-Apr-12 16:35
professionalMohibur Rashid19-Apr-12 16:35 
AnswerRe: Owner Drawn button does not get messages Pin
JohnCz24-Apr-12 12:25
JohnCz24-Apr-12 12:25 
QuestionOpening up a solution file under an older version of Visual Studio Pin
ForNow19-Apr-12 8:01
ForNow19-Apr-12 8:01 
AnswerRe: Opening up a solution file under an older version of Visual Studio Pin
Albert Holguin19-Apr-12 9:03
professionalAlbert Holguin19-Apr-12 9:03 
GeneralRe: Opening up a solution file under an older version of Visual Studio Pin
ForNow19-Apr-12 10:07
ForNow19-Apr-12 10:07 
AnswerRe: Opening up a solution file under an older version of Visual Studio Pin
Chuck O'Toole19-Apr-12 13:32
Chuck O'Toole19-Apr-12 13:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.