Im new to uvision and programming and im looking at a project that has some headers as, #include "..\..\..\swim\lpc_types.h". How do i give it the correct path to the file?..how is "..\..\..\" supposed to define a path?, ive only seen headers included like #include lpc_types.h
Note that MS-DOS and Windows-based compilers normally handles "..\.." the same as "..\\.." - they look at character following \ and decides if it is one of the standard C break sequences or not.
I didn't know about that. If it doesn't violate standard behaviour, it at least violates my expectations.
I suppose the effect would be quite violent if I were using regular expressions. Which is not really relevant on a µC, but in a regular C program I wouldn't want to do without them.
But almost anyone writing a #include with "..\.." in it, is likely to get hurt when they another day have "\bios" or "\network" or similar, and ends up with one of the C escape sequence replacements instead.
So use of a single "\" in an #include on the MS-DOS/Windows platform have caught lots of developers. And probably a number of people on other platforms too.
But both "\" and "\\" ends up in language standard texts either claiming "undefined" or "conditionally supported". While "/" is almost always supported even if the language standard doesn't require it. But "/" is part of POSIX.
POSIX is a good example why standards are less relevant than user expectations.
There's no sane fix for this, the error was using \ as a path delimiter. Because it already was established as the escape character in all computing environments.
Most C/C++ developers on Windows/.NET I know, also use / as a path delimiter in their code.
Was it?
I would say \ had a much weaker standing 1983 when MS-DOS 2.0 with directory support was relased than it has now for use as break character.
And / were used in MS-DOS 1.0 to specify a command line parameter.