I'm just getting started with D and this is completely strange. Here's my code:
class User
{
int id;
string name;
}
User b = new User();
b.name = "Edwin";
And here's my error:
root@d-testing:~/Sail/source# dmd nonsense.d
nonsense.d(8): Error: no identifier for declarator b.name
nonsense.d(8): Error: Declaration expected, not '='
What the heck am I doing wrong here? Every class example I've seen does it this way.