[C++-sig] fault core dump error

2013-09-30 Thread sam
Hello, I wrote a C program that loop inside a folder which has about 200 text files. Each file has almost 6 lines. I created 2D array [6][200] to store files in it. No compilation problem at all, but when I try to run it I get this error (fault core dump). Yes I did use malloc() This i

Re: [C++-sig] fault core dump error

2013-09-30 Thread Jonathan WRIGHT
Hello, You are reading on a closed file, try moving the fclose to the other side of the curly bracket. HTH, Jon fpr = fopen(filename, "r"); for (h=0;h ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http

Re: [C++-sig] fault core dump error

2013-09-30 Thread Jim Bosch
I think you may be sending to a mailing list that isn't really appropriate for your questions; this list concerns integrating C++ with Python (often focusing on Boost.Python), not general C/C++ programming. Good luck! Jim On 09/30/2013 11:40 AM, sam wrote: Hello, I wrote a C program that l

Re: [C++-sig] fault core dump error

2013-09-30 Thread sam
Thank you Jonathan for your quick response. well, i did move it. still same problem. it has something to do with memory On Mon, 9/30/13, Jonathan WRIGHT wrote: Subject: Re: [C++-sig] fault core dump error To: cplusplus-sig@python.org Date: Monday

Re: [C++-sig] fault core dump error

2013-09-30 Thread Holger Brandsmeier
Sam, this looks really awful: double **array1; array1 [HEIGHT][WIDTH]; do you mean: double **array1; //array1 [HEIGHT][WIDTH]; But this might not be your probablem. You say " folder which has about 200 text files", but your code is treating this as "exactly 200 text files", you need to do som