can anyone explain me? 
Author Message
 can anyone explain me?

I hope anyone can explain this to me.

This is my beispiel1.cpp-file:

namespace Export
{
        __gc public class Exportfilter
        {
        public:
                void test();
                void Oberflaechenvariablen_setzen (String
*first, String *second, String* third);
        private:
                void Variablen_setzen ();
                void Run_String_Einlesen ();
        };

Quote:
}

The test-Funktion looks like this:

void test()
        {
        Exportfilter* myExportfilter = new Exportfilter();
        myExportfilter->arraylist_leeren();
        myExportfilter->Run_String_Einlesen();
        myExportfilter->Variablen_setzen();
        }

from my win-32-applikation I call the Main-Funktion like
this:

Export::Exportfilter* myExportfilter = new
Export::Exportfilter();
myExportfilter->test();

But now I want to call the function
Oberflaechenvariablen_setzen. And this I have to call
like this:

myExportfilter->Exportfilter::Oberflaechenvariablen_setzen
(first, second, third );

My question ist now, why do I have to write here
Exportfilter::Oberflaechenvariablen_setzen and not like
this:
myExportfilter->Oberflaechenvariablen_setzen(first,
second, third ); like I call the test-function.

greetings
Susanne



Sat, 08 Jan 2005 17:27:25 GMT  
 can anyone explain me?
Hi Susanne,

When you define the method test() which is a member of the Exportfilter
class according to the class definition you need to write:
void Exportfilter::test(){...}
(unless you have your definition inline)

In the example you create an object in the main method which then calls the
test method like this:
myExportfilter->test();

If you want the test method to operate on the object you created in the main
method, put this in you test method (or maybe you wanted to create a new
object in the test method?):

void Exportfilter::test() {
    this->Run_String_Einlesen();
    this->Variablen_setzen();

Quote:
}

(You can actually omit "this->", but I think it makes things clearer when
you put it in.)

If you define your method Oberflaechenvariablen_setzen like this:
void Exportfilter::Oberflaechenvariablen_setzen(String *first, String
*second, String* third){...}

Then you should have no problem calling it:
myExportfilter->Oberflaechenvariablen_setzen(first, second, third);

Hope this helps.
/Catherine



Quote:
> I hope anyone can explain this to me.

> This is my beispiel1.cpp-file:

> namespace Export
> {
> __gc public class Exportfilter
> {
> public:
> void test();
> void Oberflaechenvariablen_setzen (String
> *first, String *second, String* third);
> private:
> void Variablen_setzen ();
> void Run_String_Einlesen ();
> };
> }

> The test-Funktion looks like this:

> void test()
> {
> Exportfilter* myExportfilter = new Exportfilter();
> myExportfilter->arraylist_leeren();
> myExportfilter->Run_String_Einlesen();
> myExportfilter->Variablen_setzen();
> }

> from my win-32-applikation I call the Main-Funktion like
> this:

> Export::Exportfilter* myExportfilter = new
> Export::Exportfilter();
> myExportfilter->test();

> But now I want to call the function
> Oberflaechenvariablen_setzen. And this I have to call
> like this:

> myExportfilter->Exportfilter::Oberflaechenvariablen_setzen
> (first, second, third );

> My question ist now, why do I have to write here
> Exportfilter::Oberflaechenvariablen_setzen and not like
> this:
> myExportfilter->Oberflaechenvariablen_setzen(first,
> second, third ); like I call the test-function.

> greetings
> Susanne



Sat, 08 Jan 2005 20:38:31 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Can anyone explain the following code ?

2. Please can anyone explain the usefulness of the macro FP_CONTRACT in C99

3. Can anyone explain "&="?

4. Can anyone explain this

5. can anyone explain these directives, perf in detail...?

6. Anyone, Please Explain (Relating to MCSD Certification)

7. Can anyone explain this strange statements?

8. Can anyone explain this???

9. Can anyone explain this?

10. Can anyone explain this?

11. Can anyone explain this output?

12. Can anyone explain this Lint warning ?

 

 
Powered by phpBB® Forum Software