r vision operations. At this point I am wondering if I can get a better performance if I do the vision processing in C/C++ instead of Java. The rest of the App is written in Java using Android Studio.
I am confused how C/C++ code is compiled and runned on Android devices. Since a Java app runs on a JVM on the Android platform I don't quite understand how the C/C++ code is compiled for the JVM and how this code runs. 
I'm thinking if the C/C++ code is compiled so that it can run in the JVM, what is the point of using it since its still running in a VM and not directly targetting the devices CPU?

A:

NDK is used for coding in C/C++. It improves application performance. NDK is usually true for many processor-bound applications
Native code(C/C++) is compiled to a binary code and run directly on OS. Java code is translated into Java byte-code to run on JVM.
You can use NDK for programming C/C++ application. You can also use QT for andriod for developing C/C++ application



Q:

Find and Replace in a C File

The Problem was to find and replace a string in a C File. 
I am new to C Files. I have tried the following code but I didnt get any output:
    #include<stdio.h>
    #include<string.h>
    int main()
    {
        FILE *f1,*f2;
        char *src,*dest,*s1,ch,ch1,ch2,ch3;
        int i;
        f1=fopen("input.txt","rw");
        f2=fopen("dummy.txt","rw");
        src="mor";
        dest="even";
        while(ch!=EOF)
        {
         ch=fgetc(f1);
         if(ch==src[0])                      //Finding 1st char of src
         {
         fgets(s1,strlen(src),f1);
         if(strcmp(src+1,s1)==0)         //Finding occurance of "src" in file
         {
          fseek(f1,strlen(src)-1,SEEK_CUR);
          while(ch1!=EOF)             //Copying remaining data into another file
          {
          ch1=fgetc(f1);
          fputc(ch1,f2);
          }
      fseek(f1,-strlen(src),SEEK_CUR);
      for(i=0;i<strlen(dest);i++)  //replacing "src" with "dest"
      {
          ch2=dest[i];
          fputc(ch2,f1);
      }
 