Re: pointer to a struct

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Mattias Sjögren (mattias.dont.want.spam_at_mvps.org)
Date: 07/23/04


Date: Fri, 23 Jul 2004 23:57:58 +0200


Since the array in the ADAPTER_STATUS is so short, one workaround is
to simply split it up in six separate byte members. That should enable
using pointers to it.

Of course this is a bit lame, and in C# v2 the new fixed array feature
provides a better solution for this, letting you write

unsafe struct ADATPER_STATUS {
  public fixed byte adapter_address[6];
  ...

Mattias

-- 
Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.


Relevant Pages

  • Re: Using sparse to catch invalid RCU dereferences?
    ... RCU-protected pointers directly, and all of these would need to be ... RCU-protected array. ... sparse doesn't have the ability to declare ... members instead of the array. ...
    (Linux-Kernel)
  • Re: Is there a programatic way to to refer to the n-th member of a struct/class with m members (n<
    ... > or at least to data members, instead of referring to the member by name? ... > Given is a pointer to the struct/class. ... If you're dealing with a non-POD struct/class, you can use pointers ... You could create an array of pointers to members ...
    (microsoft.public.vc.language)
  • Re: Pointers in C
    ... When two pointers are compared, the result depends on the relative ... or both point one past the last element of the same array ... object, they compare equal. ... If the objects pointed to are members ...
    (comp.lang.c)
  • Re: code problem
    ... > objects pointed to are members of the same aggregate object, pointers ... I suspect you can find code relying on this. ... I think I have also seen code putting an array in the ...
    (comp.os.linux.development.system)
  • Re: Pointer to Function Inside Struct using Static
    ... makes the declaration "an array of pointers to members of _MPU", ... in my it makes it "an array of pointers to functions". ...
    (comp.lang.cpp)