Why can't you open cpp files using arduino?

Ok I've been with arduino for a while now and I've got a question that's been burning me for a while now.

If arduino uses CPP files to create its libraries then why can't you open them using arduino. It kind of doesn't make since to me that I have to download a whole separate application like VSE to alter the files.

Use Sketch/add File (last entry in menu in version 1.6.5).
This will create a local copy, which you could move after successful modification.

Does notepad not work?

I just use VSE, and no my notepad will not open .cpp or .h files.

Don't need to move or copy a file I can copy and paste any file which is what I do when working on a library so I have an un-modified version but I still think you should be able to open any arduino file whether in arduino or C using the IDE.

I'm just wondering why it's not like that already?

How are you not able to open them with Notepad? I just drag and drop .h and .cpp files into Notepad (I use Notepad++), and edit and save them.

Maybe whatever OS you're on has a Notepad type app that works differently.

The Arduino IDE has "requirements" about file location and directory names for its projects ("sketches.")
You can't open a ".ino" file that isn't in the right place, either (although if you try, the IDE will offer to adjust everything so that it will work.) Within a proper sketch directory, you shouldn't have any trouble opening .cpp files.
(and yes, I think this means that you can't use the IDE directly to edit library files.)

If the .cpp is in the same folder as a .ino then it will open as another tab with the .ino.

Delta_G:
If the .cpp is in the same folder as a .ino then it will open as another tab with the .ino.

Awesome

1 Like

westfw:
I think this means that you can't use the IDE directly to edit library files.

You just need to trick the IDE into thinking it's a sketch by adding a dummy .ino file with the same name as the folder. Files in the libraries folders are treated as read only so you also need to add a file named .development to the library folder.

Notepad++ in admin mode edits and saves files in libraries folder without any fuss

Duhjoker:
I just use VSE, and no my notepad will not open .cpp or .h files.

As standard notepad from windows only lists 'Tet Documents (.txt)' in open file dialog. To see other files change to 'all files (.*)' to the right of name field.