CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: GracefulEase

Search: Search took 0.03 seconds.

  1. Re: Variables lost from object when passed to function.

    Argh, had been mistaking that constructor for the copy constructor and had indeed missed out copying over the amount! Such a ridiculous and annoying mistake! Thanks for the help!
  2. Re: Variables lost from object when passed to function.

    Here is my copy constructor:



    instruct::instruct(const char act[], const int amt)
    {
    action = new char[1 + strlen(act)]; //ADD ERROR CHECKING
    strcpy(action,act);
    amount = amt;
    }
  3. Variables lost from object when passed to function.

    So I have this object "instruct" with variables of "float amount" and "char * action". When I create an instruct and set the variables I can read from them within the same function, but when I pass...
Results 1 to 3 of 3





Click Here to Expand Forum to Full Width

Featured