By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,404 Members | 2,512 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,404 IT Pros & Developers. It's quick & easy.

what is a diff b/w extension .c & .cp

P: 5
what is a diff b/w extension .c & .cpp?
can a c program can have extension .cpp or a c program must have extension .c only?
Sep 23 '10 #1
Share this Question
Share on Google+
1 Reply


Banfa
Expert Mod 5K+
P: 8,916
Many compilers will compile c or c++ code. Generally they default to compiling as c if the file has a .c xtension and c++ if it has a .C, .cpp, .cxx extension.

However some compilers have command line switches that you can use to explicitly state which of the 2 languages you want to compile with.
Sep 23 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.