-
September 3rd, 2017, 06:23 AM
#1
Did rules for naming your files change?
Years ago when I was writing C++ code I remember you could not name a source file with spaces between the words. For example this was not allowed:
Hot Pancakes
You had to do this:
Hot_Pancakes
Or this...
HotPancakes
Now I'm writing some code again in C++ Builder and the program allows me to do this:
Hot Pancakes
So I'm wondering if they made changes to C++ along the way?
-
September 3rd, 2017, 10:22 AM
#2
Re: Did rules for naming your files change?
source file naming has never been part of the c++ specification; how #include<> or #include"" directives are interpreted ( both in terms of file location and character encoding ) is and always has been implementation defined ( the only exception being the standard headers ).
Last edited by superbonzo; September 3rd, 2017 at 10:25 AM.
-
September 4th, 2017, 02:34 AM
#3
Re: Did rules for naming your files change?
Originally Posted by 357mag
Years ago when I was writing C++ code I remember you could not name a source file with spaces between the words Hot Pancakes.
Most C++ implementations don't care how you name a file as long as the file can be found in the file system. This means it's the naming convention of the operating system that decides what is a valid file name. In Windows it's this,
https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx
So what you have noticed is because you are using a newer OS this time that is more liberal on file names.
Note that Windows doesn't allow <, > nor " to be part of file names. This of course is to avoid clashes with the syntax of the #include command. So even though C/C++ doesn't care what a file name looks like it still influences what a file name better looks like.
Last edited by wolle; September 4th, 2017 at 04:26 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|