1) i have a program which i want to execute it to a computer but i dont want to compile it but just only to run it. What i will need is only the .exe file, is that right ? Is this tactic used general or there is a more "professional" way of doing it ?
2) I would like you to suggest me a good tutorial for creating graphs using C++ or C. Actually, what am i doing now is just collecting the data i need for the graphs and use a different programm(for example Excel) to create the graphs.
But i would like my C++ or C program to extract the graphs i need.
Thanks for your help and sorry for not writing so good english.
Thanks for the reply Moschops. So the general tactic is to provide to a user our executable.
Furthermore, for the 1st question i would like to ask if we provide to a user only the executable is it possible for him to view the source code or not ? Or how can we provide our program to a user without giving him the permission to view our source code ? (i mean to provide him ONLY the fuctionallity of our program but not the source code)
Also, i am waiting an answer for the 2nd question please.
You only need to give them the executable. They can turn the source code back into assembly language, and in theory turn it back into some source code, probably not quite identical to your own. You can Google "obfuscation" to explore ways to prevent this.
Note that not all executables are standalone. They may well have been linked dynamically to the C runtime code, which means they will need a DLL file to run (Windows). Microsoft provide one called vcredist.exe for Visual C++, and there's probably an equivalent for MinGW.
Make sure you compile for final executable as "Release" configuration rather than "Debug" if applicable.
I could be more specific if you told us your IDE/compiler/etc.
As for drawing graphics, I've never done this, but if you Google around a bit, you can probably find a library which will do it for you.
There are endless ways to create an image. Here's a simple example using the easybmp library.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
BMP AnImage;
// Set size to 640 × 480
AnImage.SetSize(640,480);
// Set its color depth to 32-bits
AnImage.SetBitDepth(32);
// Now set pixels to black to make the graph - here's how to change one pixel
// Working out all the pixels to change to make the graph is up to you and involves
// some easy maths.
AnImage(14,18)->Red = 255;
AnImage(14,18)->Green = 255;
AnImage(14,18)->Blue = 255;
AnImage(14,18)->Alpha = 0;
AnImage.WriteToFile("Output.bmp");