Char[] of C# to what in C++

This is a discussion on Char[] of C# to what in C++ within the C++ Programming forums, part of the General Programming Boards category; Hi all, I need some help, I have done a program in C# and now I have to convert it ...

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    45

    Unhappy Char[] of C# to what in C++

    Hi all, I need some help, I have done a program in C# and now I have to convert it in Managed C++.

    That's the code:
    Code:
    int length;
    char[] source;
    char[] input;
    
    source=input;
    length=input.Length;
    How can I use to convert the char[] in Managed C++??

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,592
    Well C++ has
    char source[100];

    But I'm guessing using std::string will have more features, like managing the size for you.

  3. #3
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,069
    What confuses me is how C# allows a character array to have a integer member.
    Sent from my iPadŽ

  4. #4
    chococoder
    Join Date
    Nov 2004
    Posts
    515
    Probably the same Java would do it, automatic conversion of integer to string.
    C# is almost certainly smart enough to see that you're defining a string, and converting the integer to its string representation.

    In Java the following
    Code:
    String x = "" + 1;
    yields a String with the value "1".

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. question regarding char *argv[]
    By cnb in forum C Programming
    Replies: 6
    Last Post: 10-08-2008, 04:50 AM
  2. files size to char[]
    By purefan in forum C++ Programming
    Replies: 1
    Last Post: 04-03-2005, 08:43 PM
  3. ? about char somearray[] and char *somearray[]
    By newbie02 in forum C++ Programming
    Replies: 1
    Last Post: 08-29-2003, 12:43 PM
  4. Replies: 18
    Last Post: 06-21-2003, 10:57 AM
  5. int main(int argc, char *argv[]) ?
    By Shadow12345 in forum C++ Programming
    Replies: 6
    Last Post: 04-22-2002, 04:50 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21