3 ms·
int *i, j; is more than a good enough reason for me. Makes interviews interesting, though: "Why are you repeatedly writing your variables and function paramet
by drivebyacct2 14y ago
int *i, j;
is more than a good enough reason for me. Makes interviews interesting, though: "Why are you repeatedly writing your variables and function parameters incorrectly?"
- paupino_masano 14y agoInteresting example. I'm still a newbie to Go, so would that be written as: var i int* var j int My apologies if this seems like a simple question: I haven't played with the language enough to know :) [EDIT: Sorry, I didn't realize how to format code!]
- Jabbles 14y agoThe asterisk goes before the type for pointers: var i *int Unlike C, values are always initialized in Go. http://play.golang.org/p/8tAzKyES2I http://play.golang.org/p/8tAzKyES2I