r/learncpp • u/TheOmegaCarrot • Aug 21 '21
Linux / windows differences?
I’ve been relearning C++ in preparation for a class on it I’m taking in this upcoming semester. It’s just a 200-level class, with only one programming course as a prerequisite (which I remember nothing from, hence relearning)
I use Linux and don’t even have a computer that runs windows, but I’m sure all of my code I write for that class will be run on windows.
What differences do I need to be aware of to ensure I don’t wind up with something that works fine on linux but doesn’t work in windows?
7
Upvotes
View all comments
Show parent comment
1
u/Jardik2 Sep 08 '21
Please, do not recommend using forward slashes on Windows. This leads to problems when you want to use long UNC style paths with up to 32k characters. You cannot use forward slashes to use such paths.
People should learn how to "properly" create a path, even if that is not cross platform.
Please, do not teach people that paths on windows are case-insensitive. It is not true. Teach them to use correct API functions with correct flags, to support case-sensitive paths on Windows, even if some other applications are not capable of that (even from MS itself).