Re: basic question about adresses and values in structs

2014-09-04 Thread nikki via Digitalmars-d-learn
On Thursday, 4 September 2014 at 14:00:14 UTC, Ali Çehreli wrote: On 09/04/2014 02:54 AM, nikki wrote: > a pointer variable to save an adres of a function, then dereferencing to use > it. If possible, even in C, I would recommend using a 'function pointer' for that. However, there are cases wh

Re: basic question about adresses and values in structs

2014-09-04 Thread Ali Çehreli via Digitalmars-d-learn
On 09/04/2014 02:54 AM, nikki wrote: > a pointer variable to save an adres of a function, then dereferencing to use > it. If possible, even in C, I would recommend using a 'function pointer' for that. However, there are cases where the signature of the function should be unknown to the code

Re: basic question about adresses and values in structs

2014-09-04 Thread evilrat via Digitalmars-d-learn
On Thursday, 4 September 2014 at 09:54:57 UTC, nikki wrote: thanks! just what I needed, with some stumbling I managed to get everything working as intended: using a pointer variable to save an adres of a function, then dereferencing to use it. Now I am wondering when to use the ** ? for examp

Re: basic question about adresses and values in structs

2014-09-04 Thread nikki via Digitalmars-d-learn
thanks! just what I needed, with some stumbling I managed to get everything working as intended: using a pointer variable to save an adres of a function, then dereferencing to use it. Now I am wondering when to use the ** ? for example I found this function over at https://github.com/d-gamede

Re: basic question about adresses and values in structs

2014-09-01 Thread Ali Çehreli via Digitalmars-d-learn
On 09/01/2014 11:23 AM, nikki wrote: ah so much cleaner then the mess I was almost into ;) thanks In case they are useful to you or somebody else, the following chapters are relevant. Value Types and Reference Types: http://ddili.org/ders/d.en/value_vs_reference.html Pointers: http:/

Re: basic question about adresses and values in structs

2014-09-01 Thread nikki via Digitalmars-d-learn
ah so much cleaner then the mess I was almost into ;) thanks

Re: basic question about adresses and values in structs

2014-09-01 Thread Gary Willoughby via Digitalmars-d-learn
On Monday, 1 September 2014 at 18:08:48 UTC, nikki wrote: so I am still very new to structs and & and * adress and pointer stuff, I have this basic code : struct S { int value = 0; } void func(S thing){ writeln(&thing); //BFC52B44 thing.value = 100; }

Re: basic question about adresses and values in structs

2014-09-01 Thread nikki via Digitalmars-d-learn
sorry could have quicker just googled it thanks!

basic question about adresses and values in structs

2014-09-01 Thread nikki via Digitalmars-d-learn
so I am still very new to structs and & and * adress and pointer stuff, I have this basic code : struct S { int value = 0; } void func(S thing){ writeln(&thing); //BFC52B44 thing.value = 100; } S guy = {value:200}; writeln(&guy); //BFC52CCC f