As I know that .c is the extension format for c coding while cpp is the extension for c++. But I noticed that there are some c++ project use .c extension instead of cpp, is it both extension is supported in c++ compiler?
tehb
0
Newbie Poster
Recommended Answers
Jump to Post.c files are generally passed to the C compiler.
Are you sure those files really contain C++ source code?
Jump to PostMany bigger projects use building (compilation) tools such as cmake which select compilers based on the source file extensions, and .c would be passed to the C compiler. Some projects often use .c files (C code) as third-party sources for some special purposes such as hardware drivers and other IOs, …
All 5 Replies
Aranarth
126
Posting Whiz in Training
mike_2000_17
2,669
21st Century Viking
Team Colleague
Featured Poster
tehb
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
tehb
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.