How to run C/C++ Program on your Android Mobile


Want to run C/C++ programs on your Android Mobile
Want to know programs you took for copying in your college practicals run correctly. :p
Well now we have a solution on this.

C4DROID – C/C++ Compiler for Android mobiles!

Well C4droid is a simple C/C++ IDE + C/C++ compiler for Android with Makefile support.C4droid already has almost full C language support, so you don't need to wait when it will be added.

You can to write your own applications on Android phone, and run them. This app uses TCC and uClibc, so it has full support of ANSI C and some support of ISO C99. C4droid can be used for educational purposes or to practice in C language.
Some components of C4droid are LGPL-licensed. You can download used source code of TCC and uClibc on their websites 

Download: https://play.google.com/store/apps/details?id=com.n0n3m4.droidc



Compiling C++ projects:
  1. Make sure you have Enough internal memory.
  2. Install GCC plugin (C4droid will ask you to install it).
  3. Select G++ compiler in C4droid preferences.
  4. Use iostream, not iostream.h
  5. Add “using namespace std;” to your program (before int main)
Compiling Makefile projects:
  1. Open any file in the same folder with Makefile and long-click “Compile” to configure current directory (C4droid will create .c4droid configuration file when you’ll press Ok).
  2. After configuring folder, you can press compile button and C4droid will build your project.
  3. Don’t forget to enter executable name and select compilation mode (and press ok also, else changes will be discarded)
Compiling SDL/NativeActivity/Qt apps:
  1. To compile SDL/NativeActivity/Qt apps, you need GCC/G++ compiler selected (TCC is not supported).
  2. So First Install “GCC plugin for C4droid” from Google playstore.
  3. Now install “SDL plugin for C4droid“. Once you have installed both the plugins, you can now compile SDL/NativeActivity/Qt apps
  4. Make sure while compiling, GCC/G++ compiler selected is selected as TCC is not supported.
  5. SDL is detected with #include “SDL.h”, NativeActivity is detected with #include “android_native_app_glue.h”, Qt is detected with #include “QtGui”.
[ * ] If you have any “Illegal instruction” error, using internal compiler (TCC), Use GCC plugin instead, GCC supports softfloat (by default). 

  
If you cannot afford to buy this app,
Here is Mirror Link: