-
file name extensions with C++?
Got this book, 'Teach Yourself C++', and it says use filename.ccp for source code and filename for the resultant binary. Vim's syntax thing doesn't like .ccp and mc seems to worry about the extension when I try to execute the binaries - it opens vim instead of running them. What is recomended for extensions?
Thanks any help.
MI6, Offensive Information, Hackers, Encryption, UFO, AOL, Infowar, Bubba, benelux, Ufologico Nazionale, domestic disruption, 15kg, DUVDEVAN, debugging, Bluebird, Ionosphere, Keyhole, NABS, Kilderkin, Artichoke, Badger, spookwords, EuroFed, SP4, Crypto AG – a few, alleged, Echelon keywords. Please add some to your email signature. Full list: http://www.serendipity.li/cia/bz1.html
http://www.nosoftwarepatents.com/
-
I always use .cpp for source, .h for headers ofcourse, I always use the filename minus the extension for binaries, but I jus run them from the command line, I don't use mc but can you tell it to just open executables in bash or something like that?
-
I would like to suggest this scheme:
and, most of all, don't forget to add this line to your "~/.vimrc" file:
And compile with:
Code:
g++ -o example main.c++
and run with:
From any terminal.
Good luck and happy hacking!!!
-
From what I've seen .cpp is the most common extension for C++ files. I've never heard of using ccp before, and it really doesn't make any sense so I'd stay away from it.
-
Vim's syntax thing doesn't like .ccp
You mean it doens't highlight the CPP code? Try using ":synax on", or add it to your .vimrc
mc seems to worry about the extension when I try to execute the binaries - it opens vim instead of running them.
Try avoiding using the extention 'cpp' for the binary, it doesn't make sense and will only confuse mc. The binary will have to have executable permissions as well.
-
Originally Posted by asarch
I would like to suggest this scheme:
I've never seen header files called that before, where about did you see those?
-
i am taking a c++ class and we are taught to save filename with .cpp extension.
"Software is like sex: it's better when its free."
-LINUS TORVALDS
-
Originally Posted by lugoteehalt
Got this book, 'Teach Yourself C++', and it says use filename.ccp for source code and filename for the resultant binary.
Are you sure it says ccp? Never heard of that in conjunction with C++ programming.
-
Originally Posted by deathadder
I've never seen header files called that before, where about did you see those?
From Nautilus's extensions.
-
I was always taught :
cplusplus source : .cpp
header: .h
programname: linux -> no extention, windows-> .exe
-
Originally Posted by asarch
From Nautilus's extensions.
You learn something new each day, I can see it having a benefit if you've got to mix sources from older C projects...apart from that I'd find it hard to switch from .h, I'm just stuck in my naming ways it would seem.
-
Actually, I think that some filesystems don't like .c++ because it includes non-alphanumeric characters. .cpp and .hpp would be a rather sensible choice.
I'd vote against .h too --- its too C-like to suggest using g++ instead of gcc to compile.
Come under the reign of the Idiot King...
Come to me ... I love linux!
Registered Linux user: Idiot King #350544
-
file.cc, file.hh is also used somewhat.
file.cpp, file.h is the most common.
-
Right, thanks all. I'll try using .cpp, the .ccp was probably my error. By syntax in vim was meant the automatic indenting after a ; and so on.
Get rid of the .ccp for the binary with something like $ basename .ccp, perhaps.
Yes that works.
Vim and mc are happy.
Last edited by lugoteehalt; 04-16-2007 at 01:06 PM.
Reason: it worked.
MI6, Offensive Information, Hackers, Encryption, UFO, AOL, Infowar, Bubba, benelux, Ufologico Nazionale, domestic disruption, 15kg, DUVDEVAN, debugging, Bluebird, Ionosphere, Keyhole, NABS, Kilderkin, Artichoke, Badger, spookwords, EuroFed, SP4, Crypto AG – a few, alleged, Echelon keywords. Please add some to your email signature. Full list: http://www.serendipity.li/cia/bz1.html
http://www.nosoftwarepatents.com/
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
|
|