This is my code (I use Remix ethereum):
emit Transfer(_initialOwner, _initialOwner, _initialAmount);
How can I fix it?
You are most likely using too old a compiler. You need at least version 0.4.21
for you syntax - before that version the emit
keyword was not supported.
Also remember that just changing the first line of your code (the line where you specify the version) might not be enough as it's just a hint for the compiler - you also have to have the right version installed. If you use the latest remix.ethereum.org it should be fine, just use some of the latest compiler versions.
You have to perform two things
As the other user said, you need to use the higher version
emit ...
?