Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Simple, but: How convert Char to String?

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 272 Views
    Loading More Posts
    • 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.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 31/07/2007 at 04:16, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   10.111 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi,

      I have some code that works with Char arrays... like this:

      String EncodeXOR()  
      {  
      char MyString[11]="A nice cat";  
      char MyKey[11]="ABCDEFGHIJ";  
      String ResultStr;  
      for(int x=0; x<10; x++)  
      {  
          MyString[x]=MyString[x]^MyKey[x];  
          ResultStr = ResultStr + MyString[x];  
      }  
      return ResultStr;  
      }
      

      The problem is, that MyString cannot be converted to a String, so I get errors. But anyway, they're both just a chain of characters, so there has to be a possibility.

      Is there any way to convert String to Char[n] and vice versa? Or can I just forget the whole Char thing and write a function like the one shown above that works completely with String instead of Char?

      Thanks in advance for any tips. I hope to get better in C++ so I can help one day, too 🙂

      Best regards,
      Jack

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 31/07/2007 at 08:15, xxxxxxxx wrote:

        you have String::GetCString() and String::SetCString() for that 🙂

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 31/07/2007 at 08:18, xxxxxxxx wrote:

          Hey, super. I knew it was easy. But too much doc to search in may be as bad as too little doc. At least for a beginner. Thank you!

          Cheers,
          Jack

          1 Reply Last reply Reply Quote 0
          • First post
            Last post