Results 1 to 4 of 4

Thread: Return Byte Array Through Function!?!?!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    110

    Return Byte Array Through Function!?!?!

    byte val2[10];

    BYTE __stdcall getVal2[]()
    {
    return val2;
    }


    Won't let me do this...anybody know an alternative?

  2. #2
    Frenzied Member aewarnick's Avatar
    Join Date
    Dec 2002
    Posts
    1,037
    byte is a pointer to the first index of val2, not a byte.

    byte* val2[10];

    BYTE* __stdcall getVal2[]()
    {
    return val2;
    }

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    That's simply invalid:
    getVal2[]()

    What do you want to do?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403
    Looks like he just wants to return a BYTE* from a function.

    I think this is what you want?
    Code:
    BYTE val2[10];
    
    BYTE* __stdcall getVal2()
    {
         return val2;
    }
    why not just reference val2 directly?
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width