×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    May 2008
    Location
    Egypt Giza
    Posts
    52

    Exclamation C++ problem (was Re: Protected UID with Developer Certificate)

    hi thx again
    but why copy constructor can not be overloaded
    where my class have char *
    for example
    Code:
    class A{/// "class  A" as "class  CString"
    char* text;
    Public:
           A()
           {
              text = new char[100];  
           }
           A(A& in)
           {
              text = new char[strlen(in.text)+1]; 
              strcpy(text,in.text);
     
           }
           ~A()
            {
                  if(text != NULL) delete [] text;
            }
    };
            A Operator =(A _Aout,A _Ain)
            {
                strcpy(_Ain.text,_Aout.text);
            }
    ///////////////////////////////////////////////////
    A fun()
    {
         A temp;
        return temp;<<<<<<<<<<<<<<  call copy constructor and ~A 
                                    and delete text(if not implement copy constructor)
    }
    void main()
    {
       A   tempin = fun();<<<<<<<<<<   strcpy NULL A(if not implement copy constructor)
    }
    is copy *text to *text and delete contain of text
    or what is solution in this problem?????
    NOTE: is build success in debug but has error in build in release
    ERROR: cannot overloaded
    Last edited by kfke; 2008-05-19 at 15:01.

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: C++ problem (was Re: Protected UID with Developer Certificate)

    Please use the cut and paste facility in your IDE/Editor.
    It makes it VERY DIFFICULT to know which are typing errors and which are errors in your code.

    You definition of an assignment operator is wrong, it should be
    A& operator=(const A& _Ain);
    which probably explains at least one of the errors.
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

Similar Threads

  1. problem connecting when UID is randomly generated
    By nitinm22 in forum Near Field Communication
    Replies: 0
    Last Post: 2008-04-26, 19:50
  2. How to I get a screensaver Developer Certificate?
    By MobileVisuals in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 1
    Last Post: 2008-03-04, 21:53
  3. Error importing Symbian signed developer certificate
    By amaunder in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2007-03-20, 17:00
  4. expired certificate on carbide.vs sample developer certificate
    By ya_la in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 1
    Last Post: 2006-11-06, 05:53
  5. Self-signed CA certificate
    By blackbuddha in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2006-07-25, 11:03

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×