I don't quite get this thing I've noticed
-
If you just got done writing some C++ code and naturally you want to save the file, you tell Windows where you want to save it and then you will see in the bottom field the Save as Type question. If you choose .cpp, and just do that alone the file will not be saved as a C++ source file. I don't get it. Seems to me if you tell it that you want to save it as a .cpp source file then all you should have to do is just figure out what you want to name your file and that's all. But you actually have to give the file the .cpp extension yourself. You can't just do this: My Program You have to do this: My Program.cpp Why?
-
If you just got done writing some C++ code and naturally you want to save the file, you tell Windows where you want to save it and then you will see in the bottom field the Save as Type question. If you choose .cpp, and just do that alone the file will not be saved as a C++ source file. I don't get it. Seems to me if you tell it that you want to save it as a .cpp source file then all you should have to do is just figure out what you want to name your file and that's all. But you actually have to give the file the .cpp extension yourself. You can't just do this: My Program You have to do this: My Program.cpp Why?
Member 12974235 wrote:
...the file will not be saved as a C++ source file.
What will it be saved as?
Member 12974235 wrote:
You can't just do this: My Program
What happens if you do? What editor are you using?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
If you just got done writing some C++ code and naturally you want to save the file, you tell Windows where you want to save it and then you will see in the bottom field the Save as Type question. If you choose .cpp, and just do that alone the file will not be saved as a C++ source file. I don't get it. Seems to me if you tell it that you want to save it as a .cpp source file then all you should have to do is just figure out what you want to name your file and that's all. But you actually have to give the file the .cpp extension yourself. You can't just do this: My Program You have to do this: My Program.cpp Why?
-
Well if the drop down box says Save as .cpp file, Windows does not have to guess. It should be saved as a .cpp file. Otherwise we have a wasted box with useless info in it.
-
Well if the drop down box says Save as .cpp file, Windows does not have to guess. It should be saved as a .cpp file. Otherwise we have a wasted box with useless info in it.
-
Well if the drop down box says Save as .cpp file, Windows does not have to guess. It should be saved as a .cpp file. Otherwise we have a wasted box with useless info in it.
The file type recognition is controlled by windows and windows by default doesn't know what a .CPP is or many other types for that matter. More distinctly it doesn't know what program to associate to the file type. That is all done via the File Type Association widget in control panel in windows. The save file dialog is a common control dialog from windows and it is it that is directing the prompt. Usually any good installer for a C++ program makes the changes for association to the file type for you. So either you have a lazy installer for a C++ program or it made the association and you have since broken it. Whatever the case stop complaining about it and go fix it in the File Type Association widget in the windows control panel. If you need assistance an internet search on "File type association on Windows" should give you a multitude of links to work with. It's a bit like complaining when you click on a .BMP file it doesn't open it in the right editor, yeah so go fix it. As an extra helpful tip I can tell you that on the file type association it is useful to select plain text filter onto the .CPP file type. That allows windows searches to go inside your .CPP files on a text search. It is sometimes useful if you have a lot of code directories (like I do) to find a specific block of code if you know something unique about it. You can do a computer wide search for the text string in a .CPP file and it has saved me hours of searching.
In vino veritas