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. Managed C++/CLI
  4. array of strings

array of strings

Scheduled Pinned Locked Moved Managed C++/CLI
csharpvisual-studiodata-structureshelp
5 Posts 4 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.
  • J Offline
    J Offline
    John L DeVito
    wrote on last edited by
    #1

    Could anyone tell me what I'm doing wrong here: // variables defined private: array^ m_sAddressList = gcnew array{"localhost"}; private: int m_nCurrentAddress; ... // attempting to make a property out of them public: property array^ m_psAddressList{ String^ get(){ return array(m_nCurrentAddress);} } I'm getting the following compiler error: error C3901: 'get': must have return type 'cli::array ^' c:\documents and settings\john\my documents\programming\visual studio 2005\projects\winbot\winbot\ConnectionOperations.h 53 Any information would be greatly appreciated. Thanks, John

    D J 2 Replies Last reply
    0
    • J John L DeVito

      Could anyone tell me what I'm doing wrong here: // variables defined private: array^ m_sAddressList = gcnew array{"localhost"}; private: int m_nCurrentAddress; ... // attempting to make a property out of them public: property array^ m_psAddressList{ String^ get(){ return array(m_nCurrentAddress);} } I'm getting the following compiler error: error C3901: 'get': must have return type 'cli::array ^' c:\documents and settings\john\my documents\programming\visual studio 2005\projects\winbot\winbot\ConnectionOperations.h 53 Any information would be greatly appreciated. Thanks, John

      D Offline
      D Offline
      Dave Doknjas
      wrote on last edited by
      #2

      The 'get' must return an array to be consistent with how you've defined the property - e.g., return m_sAddressList. It's not clear what you are attempting to return. David Anton www.tangiblesoftwaresolutions.com Instant C#: VB to C# converter Instant VB: C# to VB converter Instant C++: C# to C++ converter and VB to C++ converter Instant J#: VB to J# converter Clear VB: Cleans up VB.NET code Clear C#: Cleans up C# code

      1 Reply Last reply
      0
      • J John L DeVito

        Could anyone tell me what I'm doing wrong here: // variables defined private: array^ m_sAddressList = gcnew array{"localhost"}; private: int m_nCurrentAddress; ... // attempting to make a property out of them public: property array^ m_psAddressList{ String^ get(){ return array(m_nCurrentAddress);} } I'm getting the following compiler error: error C3901: 'get': must have return type 'cli::array ^' c:\documents and settings\john\my documents\programming\visual studio 2005\projects\winbot\winbot\ConnectionOperations.h 53 Any information would be greatly appreciated. Thanks, John

        J Offline
        J Offline
        John R Shaw
        wrote on last edited by
        #3

        Forgive my ingnorance but what is with the '^' chaacter? The way you are using it is a syntax error in C++. INTP “Testing can show the presence of errors, but not their absence.” Edsger Dijkstra

        2 1 Reply Last reply
        0
        • J John R Shaw

          Forgive my ingnorance but what is with the '^' chaacter? The way you are using it is a syntax error in C++. INTP “Testing can show the presence of errors, but not their absence.” Edsger Dijkstra

          2 Offline
          2 Offline
          2bee
          wrote on last edited by
          #4

          John R. Shaw wrote:

          Forgive my ingnorance but what is with the '^' chaacter? The way you are using it is a syntax error in C++.

          Hi, It would be a syntax error in standard c++ but isn't this the (Managed) C++/CLI discussion board? Therefore i would like to point out: "The carat operator (^) (often called a "hat" by C++/CLI folks) indicates that a variable or parameter refers to a reference-type object." Or did i misread your point? regards Tobias :cool:

          J 1 Reply Last reply
          0
          • 2 2bee

            John R. Shaw wrote:

            Forgive my ingnorance but what is with the '^' chaacter? The way you are using it is a syntax error in C++.

            Hi, It would be a syntax error in standard c++ but isn't this the (Managed) C++/CLI discussion board? Therefore i would like to point out: "The carat operator (^) (often called a "hat" by C++/CLI folks) indicates that a variable or parameter refers to a reference-type object." Or did i misread your point? regards Tobias :cool:

            J Offline
            J Offline
            John R Shaw
            wrote on last edited by
            #5

            2beeOr did i misread your point?

            Nope! You told me exactly what I wanted to know. I had a feeling it was something like that, as if C++ did not have enough operators already. INTP “Testing can show the presence of errors, but not their absence.” Edsger Dijkstra

            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