- Home Page of ProjectGuideline.com ›
- Forums ›
- Get Help to do your B.E., and M.E., M.Tech., & M.S., Project in Ns2 ›
- FILE * causing segmentation fault
mystique
Participant
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
Viewing 0 reply threads
You must be logged in to reply to this topic.