Is this line in the collision tutorial wrong?

So there’s a line in this tutorial that doesn’t look right:
https://docs.unrealengine.com/latest/INT/Programming/Tutorials/Components/5/index.html

Am I missing something? Or is this incorrect? Why is “class” there?

    class UCollidingPawnMovementComponent* OurMovementComponent;

This is correct but optional syntax. You could also write

UCollidingPawnMovementComponent* OurMovementComponent;

However, putting class in front is not a syntax error. So to answer your question, no, this is not incorrect.

To be more precise, this is called an “elaborated type specifier”, you can read about it here : Elaborated type specifier - cppreference.com

Sometimes it will be necessary for disambiguation, but in your case, I don’t think it is (but I would need to see the rest of the code to be sure).

Hope this helps,

Mick

Awesome, thanks for the info!

Don’t forget to accept the answer if it helped you :slight_smile: