Reputation: 5037
I am wondering if it is possible for me to use Embarcadero c++ 2010 in order to compile a source code which i got from internet. I have this software installed in my PC, and i don't know to download a c compiler because i think it is already possible to do that using embarcadero.
I clicked on File -> New -> Other -> C Document
But the problem is when i typed my C code inside, i didn't get to click on the Compile button ( The green button ) because it is disabled. Can you help me compile a C source code using embarcadero c++ ?
Upvotes: 0
Views: 1415
Reputation: 214810
int main(void)
format. If it is a Windows API application with windows, don't click console application.Upvotes: 3
Reputation: 55583
As far as my knowledge goes, C++ is a superset of C, meaning all most code that is valid in C is valid in C++. Just rename your .c
files to .cpp
and see if it works.
Note that some problems may persist with naming of variables (class, private, etc. Are valid variable names in C, but in C++ they will throw a compiler error), but for the most part this should work.
Upvotes: 0
Reputation: 28583
Given that this Embarcadero product looks like a full featured IDE, you probably need to start with a project, probably console based (depends on the code you downloaded).
Then you would add the C code to the project.
If you don't have a project, the IDE is not going to know how you want the results: library, DLL, console application, windowed application, etc.
Upvotes: 2