Home > Mobile >  Qt project under win10 normal but Ubuntu16.04 cannot run normally
Qt project under win10 normal but Ubuntu16.04 cannot run normally

Time:09-20

I am a small white one, recently met a question want to consult everybody, the part program is as follows, version for 5.11.0 win10, under win10 can run normally read a file, but Ubuntu program automatically terminate for press return to exit the terminal, also does not display the file open failed, what reason is this? Or pop up after the return to exit the terminal longer should I wait?
CGPT2_1w_World TROP.
TROP. Init_trop ();

Void CGPT2_1w_World: : init_trop ()
{
The string filename="gpt2_1wA_World. TXT";
Fstream infile.
Infile. Open (filename, the ios: : in);

if (! Infile)
{
QDebug (" file open failed ");
Assert (false);
}
String strLine;
Getline (infile strLine);
Int n=0;

While (getline (infile strLine))
{
The vector & lt; string> arry;
The split (strLine, "", 'arry);
Size_t len='arry. The size ();
Double vel [44].
for (int i=0; i {
Vel [I]=atof (' arry [I] c_str ());
}

for(int i=0; i<5; I++)
{
Pgrid [n] [I]=vel [I + 2];

Double temp=pgrid [n] [I];
Tgrid [n] [I]=vel [I + 7),
Qgrid [n] [I]=vel [I] + 12/1000;
DTgrid [n] [I]=vel [I + 17]/1000;
Ahgrid [n] [I]=vel [24] I +/1000;
Awgrid [n] [I]=vel [29] I +/1000;
Lagrid [n] [I]=vel + 34 [I];
Tmgrid [n] [I]=vel + 39 [I];
}
U=vel [n] [22].
The Hs [n]=vel [23].
n++;
}
Infile. Close ();
QDebug (" initialization is complete! \n");
}

CodePudding user response:

Now debugging found a grey wavy lines under the temp, debugging errors seemed to contain null pointer exception so quit, could you tell me how to change it

CodePudding user response:

Pgrid=new double * [64800];
Tgrid=new double * [64800];
Qgrid=new double * [64800];
DTgrid=new double * [64800];
U=new double [64800].
The Hs=new double [64800];
Ahgrid=new double * [64800];
Awgrid=new double * [64800];
Lagrid=new double * [64800];
Tmgrid=new double * [64800];
Is creating a new temporary variables, which leads to the end of the function can lead to a null pointer?
  •  Tags:  
  • Qt
  • Related