Question: when I launch emulator I am getting error as 

> 
> Emulator: PANIC: Missing emulator engine program for 'arm' CPU.
> 
> 
> Emulator: Process finished with exit code 1
> 
> 
> 

Win 10 , Android Studio3.1.4 , AVD Nexus 4 Api21

Answer: 
Automatic variables are typically placed on the call stack. The default size of the call stack on most desktop systems is from one to a few megabytes. The size of `double [800050][1]` is over six megabytes (assuming the size double is eight bytes). The result of using such a huge automatic variable results in a *stack overflow*, as you have observed.

Don't use automatic variables for large objects. You can allocate the object dynamically instead. In this case, you can use `std::vector<double>`.

Another issue is that you've hard coded the size of the array, and therefore you risk overflowing the array even if it did fit on the stack. When you use `std::vector`, you can let it grow dynamically instead of hard coding the size.
you are (as mentioned in error) doing a stack overflow when allocating:

```
  double x_array[800050][1] ;

```

you should try to allocate it on the heap (directly using new, or indirectly using a std container like std::vector)