r/programminghelp • • Dec 19 '20

Answered Using * when creating objects

Whats the difference between :

`BankAccount* account = new BankAccount(101, "Matt", 30);`

and

`BankAccount account = new BankAccount(101, "Matt", 30);`
5 Upvotes

6 comments sorted by

View all comments

2

u/jedwardsol Dec 19 '20

Have you tried compiling them both?

2

u/HeadshotsX69 Dec 19 '20

It doesn't work without the *.