This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Having problem with files


Hi,
  I am having problem with files. 
  after writing a data file of size 1000x2000 matrix ..when i am again using it for
writing data of some other file, at that time  I am getting segmentation fault.
for datasize of 200x500 matrix its working fine ...but for 1000x2000 i am not able to
understand what is the problem?
here is the error which i am getting.

0  0x08049362 in dataconverterto() () at main.cpp:284
#1  0x08048be9 in main () at main.cpp:105
#2  0x401167f7 in __libc_start_main () from /lib/i686/libc.so.6

 Can anyone suggest  me what mistake i am doing? or any suggestion???
thanks in advance.

my prog is something like this....

int main()
{  
 datagenerator();
dataconvertor();
}

void datagenerator()
{ ostream ofile("data_in" , ios::out);
......after generating file
ofile.close();

}

void dataconvertor()
{ 
  istream ifile("data_in", ios::in);
 ostream outfile("data_out", ios::out);

 ........after converting data from data_in to data_out file 

  ifile.close();
  outfile.close();

}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]