Type Convert (Static Array TO unsigned char ) Help.

This is a discussion on Type Convert (Static Array TO unsigned char ) Help. within the C++ Programming forums, part of the General Programming Boards category; Hi All, Good day. public: static array<Byte>^tmpArray = gcnew array<Byte>(10000000); ....... unsigned char text[] = tmpArray[]; // Compiled error. How ...

  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
    839
    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 07: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, 02: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-30-2005, 12:21 AM
  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

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