Home > Back-end >  C access conflicts
C access conflicts

Time:12-11

#include
#include
#include
#include
#include
#include
#include

using namespace std;

//the string into a digital
Double zhuanzhi (string zifuchuan)
{
Double b;
Stringstream c;
C & lt; C & gt;> b;
Return b;
}

Int main ()
{//read the data
Ifstream infile.
Infile. Open (" D: \ \ XYZ2BLHNEU xyz ", the ios: : in);
if (! Infile)
{
Cout & lt; <"Error" & lt; }

The string line, str_temp;
Int start, pos;
Int n=14435;
Double X [14435], [14435] Y, and Z [14435], [14435] m.;
for (int i=0; i {
Getline (infile, line);
Pos=0;
Start=0;
Pos=line. The find (", ", start);
Start=pos + 1;
Pos=line. The find (", ", start);
Str_temp=line. Substr (start, pos - start);
[I]=X zhuanzhi (str_temp);
Start=pos + 1;
Pos=line. The find (", ", start);
Str_temp=line. Substr (start, pos - start);
[I] Y=zhuanzhi (str_temp);
Start=pos + 1;
Pos=line. The find ("/n ", start);
Str_temp=line. Substr (start, pos - start);
[I] Z=zhuanzhi (str_temp);

}
Infile. Close ();
//define WGS_84 commonly used constants
Double a=6378137;//the unit is m
Double b=6356752.3142;//the unit is m
Double e2=0.00669437999013;//the first debunked the heart rate square
Double E2=0.00673949674227;//the second eccentricity square
Double PI=3.1415926535897932;

Double c=(a * a)/b;
Double k=1 + E2;
Double B [14435], [14435] L, H [14435], t0 [14435], [14435], p N [14435].

for (int j=0; J & lt; n; J++)
{
[j] M [j]=Y/X [j];
L [j]=atan (M) [j];
[j]/[j]=t0 Z SQRT ([j] * X X [j] + [j] * Y Y [j]);
P=c * [j] e2/SQRT ([j] * X X [j] + [j] * Y Y [j]);


Double s=1, t2=t0 [j], t3.
While (s & gt; 0.001)
{

T3=t0 [j] + p [j] * t2/SQRT (k + t2 * t2);
S=fabs (t3 - t2);
T2=t3;

}
B [j]=atan (t3);
N [j]=c/SQRT (1 + E2 * cos (B [j] * cos (B [j])));
H [j]=SQRT ([j] * X X [j] + [j] * Y Y [j])/cos (B) [j] - N [j];
}

//output coordinates results to the file
Ofstream outfile;
Outfile. Open (" D: \ \ BLH TXT ");
For (int f=0; F & lt; n; F++)
{
Outfile & lt; }
Outfile. Close ();
return 0;
}
Why the system will
0 x00a727b9 (located in the ground has a fixed coordinate system transformation. Exe) caused by abnormal: 0 xc0000005: while reading position 0 x01200000 access conflict,
Error, please explain!

CodePudding user response:

Linux:
Process exit would have a "core" in the current directory files or form such as' core. The digital files such as' core. 1234 '
Using the command
GDB to run the program of the core or the core. The digital
Enter the GDB and then use the bt command
Can view the process exit before the function call stack, content is from the top to the following out of from the inner to outer function call history,
If process exit does not produce the core file, the reference "ulimit -c size the most large core file" command


Windows:
Collapsed in the pop-up dialog box, press the corresponding button to enter debugging press Alt + 7 key to view the Call Stack, namely "the Call Stack" from the inside to the following out of from the inner to outer function Call history, double-click a row to the cursor to the Call of the source code or assembly instruction, don't understand when double click on the next line, until we can read ,
  • Related