|
Hello!
I have 2 questions:
1) How do I declare multidimensional arrays (matrices) in C++??? Can anybody describe it in detail? This is probably a very simple thing, isn´t it?
2) If the first problem is working...can I then declare an array as a member-variable, so that I am able to use this array in my whole program?
Thanks for your help!!!
|
|
|
|
|
Anonymous wrote:
How do I declare multidimensional arrays (matrices) in C++???
Look at this[^], it can help you.
Anonymous wrote:
can I then declare an array as a member-variable
Sure, as any other var.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
<font color=blue>#define</font> <font color=purple>NULL</font> (<font color=blue>(void</font>*)0)
<font color=blue>class</font> myProgram {
<font color=blue>typedef double</font> ValueType;
<font color=blue>typedef</font> ValueType[][] Matrix; <font color=green>
<font color=blue>private</font>:
Matrix m_matrix; <font color=green>
<font color=blue>public</font>:
myProgram() {
m_matrix = <font color=purple>NULL;</font>
}
myProgram(<font color=blue>int</font> dimX, <font color=blue>int</font> dimY) {
<font color=green>
m_matrix = <font color=blue>new</font> ValueType[dimX][dimY];
<font color=green>
<font color=blue>for</font> (<font color=blue>int</font> i = 0; i < dimX; i++) {
<font color=blue>for</font> (<font color=blue>int</font> j = 0; j < dimY; j++) {
m_matrix[i][j] = <font color=blue>new</font> ValueType();
}
}
}
};
now, you create it like that :
myProgram mp(5, 3); <font color=green>
<font color=green>
<font color=green>
cheers,
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 10:18 Tuesday 30th August, 2005
|
|
|
|
|
|
Roland Pibinger wrote:
Have you actually compiled that with a C++ compiler? [confused]
what's wrong with my code (except the fact that it is just an example, and certainly should contain much features to be used correctly) ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 2:36 Wednesday 31st August, 2005
|
|
|
|
|
Hi all
I am making an application using property pages. I have used 15 dialog pages.
Now the problem is that when program is executed then only two rows of tabs(8-9 tabs) are displayed and as soon as any tab is clicked all tabs are displayed in three rows.
So please tell me that how can I resolve this problem?
Thanks & regards
|
|
|
|
|
Hi All
I had send a query & waiting for reply by you,
Please reply I am in trouble.
Thanks & Reagards.
Bye
|
|
|
|
|
Hi
I am having a application which I am using to monitor file operations. i have registered my application with the shell using ShChangeNotifyRegister API . If I run my application as a standalone application I am able to get the notifications . But if I run my application as service ShChangeNotifyRegister API is returning Invalid handle value . I m not able to register my application with the shell . Since ReadDirectorychanges is not supported in 98/me i am relying upon ShChangeNotifyRegister . I request you to give me a suggestion .
Vijayaragavan
|
|
|
|
|
hi,
anyone know how to read the VERSION value in the resource file? i am referring to VERSION value that can be found as file version, product version in the windows explorer.
basically, i want to read this value and write to the log file.
any have any idea?
thanks!
|
|
|
|
|
|
How do I mail a file from VC++/MFC application?
I assume there should be a simple function that can implement this...
|
|
|
|
|
|
MAPI Support in MFC[^]
Simple MAPI[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
|
How to create a service in vc++ that should run automatically when ever we start the system
|
|
|
|
|
|
|
snprani@yahoo.com wrote:
How to create a service in vc++ that should run automatically when ever we start the system
You will find this link intresting
http://www.codeproject.com/system/#Services[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi all
I want to enumerate all the ports of my PC( e.g. Primary IDE, secondary IDE,COM1, COM 2, LPT1, PS/2 etc.).
How can I achieve this, either by using MFC or any API or any other way.
Please Reply
Thanks & Regards.
|
|
|
|
|
Hello guys out there. I've been doing my project and have some additional functions/codes I added. When I try to compile it returns some error.
The compiling error is shown like this:
--------------------Configuration: WebJudge - Win32 Debug--------------------
Compiling...
MyProjectView.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\MyProject\MyProjectView.cpp(225) : error C2228: left of '.InsertRowTable' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\MyProjects\MyProject\MyProjectView.cpp(228) : error C2228: left of '.WriteHtmlFile' must have class/struct/union type
Error executing cl.exe.
MyProject.exe - 2 error(s), 0 warning(s)
-----------
From my MyProjectView.cpp (where the error is):
void CMyProjectView::CreateHtmlFile()
{
CPtrArray* pPageInfos = CDatabase::GetInstance()->GetPageInfo();
CHtmlEdit oHtmlEdit();
for (int nIndex = 0; nIndex < pPageInfos->GetSize(); nIndex++)
{
CPageInfo *pPageInfo = (CPageInfo*)pPageInfos->GetAt(nIndex);
oHtmlEdit.InsertRowTable(nIndex, pPageInfo->ToString());
}
oHtmlEdit.WriteHtmlFile("./demo.htm");
}
----------------
Can someone out there, what went wrong with my code? I really don't know how I will solve that.
Thanks and best regards.
With great power comes a great responsibility.
|
|
|
|
|
have u added header for class CHtmlEdit. that might be possible reason.
|
|
|
|
|
Hello
It seems to me you try to create an object of type CHtmlEdit . So, I think You have to remove () from the following statement:
CHtmlEdit oHtmlEdit();
If you omit the paranthesis, an object is created and the default constructor is automatically called.
I hope this solves your problem.
|
|
|
|
|
Thank you guys. No more error now. . Thanks for the quick reply. ciao!
With great power comes a great responsibility.
|
|
|
|
|
It is MDI application in vc++. It contains 32 dialogs. Each dialog could contains 4 to 7 tabs. When I am running my application and opened one Child dialog. switched between two tabs in same child dialog. Suddenly XP feature got disabled. I am working on WINDOWS XP, VC++6.0. How can I solve this problem. Kindly let me know the solution.
Why this problem is comeing. Can any one help me in this.
Cheers
-Haranadh
-- modified at 2:21 Wednesday 31st August, 2005
|
|
|
|
|
I know how to import the .lib files into vc++, but how to use them?
if I import MSN Messengers .lib files, then I can see its classes like DMessengerEvents::OnSignin;
but when I creat a button and put the code in Onclick, then nothing happen... any ideas about this?
|
|
|
|