Hello, I am trying to understand linked lists. The following code is from a book.
My question is, what does "EnemySpaceShip *getNewEnemy ()" mean? I understand this statement if it were written like so: "EnemySpaceShip *getNewEnemy". That this is a pointer to a structure named EnemySpaceShip. However, I lose my understanding when the statement includes () like so "EnemySpaceShip *getNewEnemy ()". Any suggestions on how to understand this statement?
line17: EnemySpaceShip *getNewEnemy ()
here the function name is getNewEnemy and it returns a pointer of type EnemySpaceShip. notice that it returns p_ship.
it's more clear to understand: EnemySpaceShip* getNewEnemy ()
Thank you for your response. One another question. What does "p_enemies = p_ship" mean? I don't think this is dereferencing a p_enemies because to dereference it, I need to use "*", that is, *p_enemies, to dereference. So what is this statement saying?