Re: Two interpretations

2021-06-11 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Jun 11, 2021 at 03:00:00PM +, JG via Digitalmars-d-learn wrote: > Is it specified somewhere which way the following program will be > interpreted? > > import std; > > struct A > { > int x=17; > } > > int x(A a) > { > return 100*a.x; > } >

Two interpretations

2021-06-11 Thread JG via Digitalmars-d-learn
Is it specified somewhere which way the following program will be interpreted? import std; struct A { int x=17; } int x(A a) { return 100*a.x; } void main() { A a; writeln(a.x); }