Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 21st, 2005, 12:21 AM   #1
Michael Edgar
Newbie
 
Join Date: Mar 2005
Posts: 1
Rep Power: 0 Michael Edgar is on a distinguished road
fprintf segmentation fault

I am using this line of code in my program:

fprintf(stderr, "Running interchange total is: %d\n", interchangeCount);

This causes a segmentation fault. However, if I change the line to this:

printf("Running interchange total is: %d\n", interchangeCount);

there is no segmentation error. If I add for instance 'fputc(0, stderr);' before OR after the bad fprintf, there also is no segmentation fault. I can also remove the '%d' and 'interchangeCount' from the bad fprintf and stop the fault. Any help/insight would be appreciated.
Michael Edgar is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:27 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC