Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. error message: no copy constructor available for 'CStringArray'

error message: no copy constructor available for 'CStringArray'

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cy163 hotmail com
    wrote on last edited by
    #1

    I create a member function with a CStringArray type variable in the argument list. I got the following error message " no no copy constructor available for the class 'CStringArray' Is there are any solutions or workarounds. Thank you

    B N 2 Replies Last reply
    0
    • C cy163 hotmail com

      I create a member function with a CStringArray type variable in the argument list. I got the following error message " no no copy constructor available for the class 'CStringArray' Is there are any solutions or workarounds. Thank you

      B Offline
      B Offline
      Benoy Bose
      wrote on last edited by
      #2

      You can not use pass an object of a CStringArray since it has no CopyContructor or assignment operator. One thing you can do is to pass a reference to the string array. eg: // use void function( CStringArray& csStringArray_i ) { } // instead of void function ( CStringArray csStringArray_i ) { } // One thing is to be noted down is not to pass any local variable of CStringArray to the function it may not work properly, especially playing with multiple threads.

      1 Reply Last reply
      0
      • C cy163 hotmail com

        I create a member function with a CStringArray type variable in the argument list. I got the following error message " no no copy constructor available for the class 'CStringArray' Is there are any solutions or workarounds. Thank you

        N Offline
        N Offline
        Nibu babu thomas
        wrote on last edited by
        #3

        cy163@hotmail.com wrote:

        " no no copy constructor available for the class 'CStringArray'

        CStringArray does not have a copy constructor. Use a reference instead...

        bool PassingCStringArray( CStringArray**&** csaArray );


        Nibu thomas A Developer Programming tips[^]  My site[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups