Search

June 17, 2021
Learn »
...my first example:

```d
struct Foo{
	int bar;
}

__gshared Foo foo;
void *fooptr = &foo;
```

This...
June 17, 2021
General »
...Foo{
	
    int test()@safe{
    	return 1;
    }

}
struct Bar{
	
    int test()@system{
    	return 2;
    }

}

void system...
June 16, 2021
Learn »
...0x55fbd8292030
	printf("Address of bar: %p\n", barptr); //Address of bar: 0x55fbd8292030
	printf("Address of...
June 16, 2021
Learn »
...bar;
> }
>
> void* membaddr(void *ptr, ulong offset){
>      return ptr+offset;
> }
>
> __gshared Foo foo;
> void* bar...
June 16, 2021
Learn »
...c
struct Foo{
    char bar;
};

struct Foo foo;
void *ptr = &foo.bar; //compiles, links and...
June 16, 2021
Learn »
...bar;
}

void* membaddr(void *ptr, ulong offset){
    return ptr+offset;
}

__gshared Foo foo;
void* bar...
June 16, 2021
Learn »
...foo.addrOf.bar);
  writeln(foo.addrOf.i);

  // Alternative syntax
  writeln(addrOf(foo).bar);
  writeln(addrOf...
June 16, 2021
General »
...the pointer within the @trusted block and `bar` assigns it outside the @trusted block. It...
June 16, 2021
Learn »
...initialize() { bar = &foo.bar; }

void main()
{
    *(cast(ubyte*)bar) = 10;
    printf("%d", foo.bar);
}
```

https...
June 16, 2021
Learn »
...Foo{
 ubyte bar;
}

__gshared Foo foo;
void* baz = \&foo;       //works
void* bar = \&foo.bar;   //Error...
77 78 79 80 81 82 83 84 85 86 87 88
Next ›   Last »