Click here to Skip to main content
15,921,837 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to convert from WPARAM or LPARAM to CString Pin
Jörgen Sigvardsson20-Sep-06 3:34
Jörgen Sigvardsson20-Sep-06 3:34 
Questioncreating an array of objects dynamically Pin
erfi20-Sep-06 1:56
erfi20-Sep-06 1:56 
AnswerRe: creating an array of objects dynamically Pin
toxcct20-Sep-06 1:57
toxcct20-Sep-06 1:57 
GeneralRe: creating an array of objects dynamically Pin
erfi20-Sep-06 1:59
erfi20-Sep-06 1:59 
GeneralRe: creating an array of objects dynamically Pin
toxcct20-Sep-06 2:06
toxcct20-Sep-06 2:06 
GeneralRe: creating an array of objects dynamically Pin
erfi20-Sep-06 2:09
erfi20-Sep-06 2:09 
GeneralRe: creating an array of objects dynamically Pin
Zac Howland20-Sep-06 3:46
Zac Howland20-Sep-06 3:46 
AnswerRe: creating an array of objects dynamically Pin
_AnsHUMAN_ 20-Sep-06 2:14
_AnsHUMAN_ 20-Sep-06 2:14 
erfi wrote:
how i can call the Row() constructor for this array? is this possible?

It is possible to call the constructor of the row class. It get's invoked automatically on creation of an object.
ex: This code is not optimized. You should be using destructor of the classes to free the total amount of memory being allocated in this process.
#include "stdafx.h"
#include <iostream>
using namespace std;
class Row
{
private:
	char *termState;  
	int *terms;    
public:
	Row(int length,int mTCount);
	void Display(); 
};
Row::Row(int a,int b)
{
	cout<<"Constructor of the row class is invoked"<<endl;
	// allocate memory using new
	termState=new char[a];
	terms=new int[b];

}
void Row::Display ()
{
	// example
	cout<<"Display of row class";
}
// Class table
class Table
{
private:
        Row *rows[5];
public:
        Table(int);
};
Table::Table(int a)
{
	// we are not using a here
	for ( int i=0;i<5;i++)
	{
		rows[i]=new Row (5,10);
		rows[i]->Display();
	}
}
int _tmain(int argc, _TCHAR* argv[])
{
	Table t(10);
	return 0;
}


Somethings seem HARD to do, until we know how to do them.
Wink | ;-) _AnShUmAn_

GeneralRe: creating an array of objects dynamically Pin
erfi20-Sep-06 2:55
erfi20-Sep-06 2:55 
GeneralRe: creating an array of objects dynamically Pin
benjymous20-Sep-06 3:25
benjymous20-Sep-06 3:25 
GeneralRe: creating an array of objects dynamically [modified] Pin
_AnsHUMAN_ 20-Sep-06 3:33
_AnsHUMAN_ 20-Sep-06 3:33 
GeneralRe: creating an array of objects dynamically Pin
toxcct20-Sep-06 4:35
toxcct20-Sep-06 4:35 
QuestionCFile Pin
Sonia Horra20-Sep-06 1:39
Sonia Horra20-Sep-06 1:39 
AnswerRe: CFile Pin
_AnsHUMAN_ 20-Sep-06 1:42
_AnsHUMAN_ 20-Sep-06 1:42 
GeneralRe: CFile Pin
Sonia Horra20-Sep-06 2:52
Sonia Horra20-Sep-06 2:52 
GeneralRe: CFile Pin
Hamid_RT20-Sep-06 7:36
Hamid_RT20-Sep-06 7:36 
AnswerRe: CFile Pin
pavan_sw20-Sep-06 20:53
pavan_sw20-Sep-06 20:53 
QuestionAbout windows Events Pin
janadhana20-Sep-06 1:09
janadhana20-Sep-06 1:09 
AnswerRe: About windows Events Pin
Mr.Brainley20-Sep-06 2:21
Mr.Brainley20-Sep-06 2:21 
GeneralRe: About windows Events Pin
janadhana21-Sep-06 2:04
janadhana21-Sep-06 2:04 
QuestionA Simple Namespace Extension Question Pin
Dave Kerr20-Sep-06 0:57
Dave Kerr20-Sep-06 0:57 
QuestionCan I call the open folder dialog directly? Pin
BarryOg20-Sep-06 0:40
BarryOg20-Sep-06 0:40 
AnswerRe: Can I call the open folder dialog directly? Pin
Christian Graus20-Sep-06 0:51
protectorChristian Graus20-Sep-06 0:51 
QuestionRe: Can I call the open folder dialog directly? Pin
BarryOg20-Sep-06 0:59
BarryOg20-Sep-06 0:59 
AnswerRe: Can I call the open folder dialog directly? Pin
Haroon Sarwar20-Sep-06 1:27
Haroon Sarwar20-Sep-06 1:27 

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.