Thread: Type Convert (Static Array TO unsigned char ) Help.

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    48

    Smile Type Convert (Static Array TO unsigned char ) Help.

    Hi All,

    Good day.


    public:
    static array<Byte>^tmpArray = gcnew array<Byte>(10000000);

    .......


    unsigned char text[] = tmpArray[]; // Compiled error.

    How to assign the tmpArray value to text[]


    Thanks in advance.
    --------------------------------------------------------
    Newbie
    C/C#/C++
    swimming/cycling/running
    There is nothing more powerful than an idea.
    Except for an idea put into action.
    --------------------------------------------------------

  2. #2
    3735928559
    Join Date
    Mar 2008
    Location
    RTP
    Posts
    838
    you appear to be using C#, which i am unfamiliar with.

    in c++ the syntax is:

    Code:
    unsigned char* text = (unsigned char*)tmpArray;
    // text now points to the first byte of tmpArray but does not create a second copy
    Last edited by m37h0d; 10-28-2009 at 06:53 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sorting the matrix question..
    By transgalactic2 in forum C Programming
    Replies: 47
    Last Post: 12-22-2008, 03:17 PM
  2. seg fault at vectornew
    By tytelizgal in forum C Programming
    Replies: 2
    Last Post: 10-25-2008, 01:22 PM
  3. convert unsigned char to char *
    By keeper in forum C++ Programming
    Replies: 2
    Last Post: 03-03-2006, 06:53 PM
  4. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  5. Writing structure in a unsigned char array
    By nasir_sidd in forum C++ Programming
    Replies: 1
    Last Post: 12-10-2002, 04:09 AM