#include <> vs #include ""

Hello,

I’m using Visual Studio Community 2019 and whenever I try to include a header file, Visual Studio is unable to autocomplete the folders and files. That is until I tried using

#include <GameFramework/ProjectileMovementComponent.h>

Is there a potential risk or big difference using these <> (greater than, less than) instead of the “” (quotes) ?

They have slightly different behaviour which you can read here

https://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename

Generally you would use <> for system (inc. Standard Library) headers and "" for your project’s. Companies tend to have their own conventions too, Google for example always use "" regardless what for.

Unreal follows pretty much the same guidelines. You are free to use what you want but you would be going against Unreal’s convention. <> also doesn’t work with Unreal’s generated headers for whatever reason.

Thanks for explaining the difference. That’s helpful.
I’m going to stick with the quotes as it is Unreal’s guidelines. Will only use the brackets <> for searching the header files.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms