--- On Sun, 5/24/09, Meeta Gupta <[email protected]> wrote:
From: Meeta Gupta <[email protected]>
Subject: FILE * producing segmentation fault
To: [email protected]
Date: Sunday, May 24, 2009, 11:34 AM
hi users,
please help me with this problem. i am trying to implement a
new agent. i have a method that is periodically invoked to write some
statistics in a file. whenever i try to print something in the text file using
fprintf i get a segmentation fault. anything without the file pointer seems to
work. i have the following lines in my c++ code....
void myAgent:: print_info()
{
FILE * fp;
fp = fopen("/Documents/ns-allinone-2.31/text.txt", "a");
fprintf(fp, "something") ; //////////causes segmentation fault
}
thanks
meeta