What is the correct way to include files
#include "../myDirecoty/myFile.h"
or
#include "..\myDirecoty\myFile.h"
the difference is the direction of "/" or "\".
What is the correct way to include files
#include "../myDirecoty/myFile.h"
or
#include "..\myDirecoty\myFile.h"
the difference is the direction of "/" or "\".
There is no difference, but the first form is more "clear" because sometime people thinks to \ as an escaping character in string (but include path are not strings)
From what I've seen looking through the code on my computer, you should use forward slashes ('/').
The backslash \
is used on Windows and DOS, while the slash /
is used on all UNIX/POSIX compatible systems (like Linux and Mac OS X). So the later can produce a file-not-found error on non-Windows systems. AFAIK all Windows compiler do support the slash /
, so this is one to use.
Edit: See also this SO question.