Hello everyone,
Statement like this,
extern int i = 3;
1. Is it correct?
2. Is it definition or declaration? Any special function or benefits we could get compared with
extern int i; or
int i = 3
thanks in advance,
George
Printable View
Hello everyone,
Statement like this,
extern int i = 3;
1. Is it correct?
2. Is it definition or declaration? Any special function or benefits we could get compared with
extern int i; or
int i = 3
thanks in advance,
George
1) No.
And I thought I had made it quite clear in my other post that it was an example of what could happen if such code was legal.
This was discussed yesterday - or was it the day before - and no, you should not be allowed to do that.
--
Mats
A definition does not have an extern keyword.
Using the extern keyword, it can only be a declaration and thus it cannot be initialized.