printf buffer strange behaviur

Reply

Join Date: Sep 2003
Posts: 81
Reputation: Valmian is an unknown quantity at this point 
Solved Threads: 0
Valmian Valmian is offline Offline
Junior Poster in Training

printf buffer strange behaviur

 
0
  #1
Sep 16th, 2003
ok.. it seems like with every step in my program I stuble on more and more unconrprehendable errors.. this time it is with the printf function. When I am printing:
"
fflush (stdout);
puts ("\nOrganized data:");
for (int i=0; i<sdata.width; i++)
printf ("'%s',",sdata.ar[i].name);
puts ("\b");
for (int a=0; a<sdata.rows; a++)
{
for (int b=0; b<sdata.width; b++)
{
printf("%d,",sdata.ar[b].values[a]);
}
puts("\b");
}
"
if I have a printf call that uses that class all works fine but if I don't call it before (at the end I won't get it printed at all since this is internal data, not for user) it showes a bunch of mambo-jambo before and after the printed segment. It seems to be a buffering problem so that is why I used fflush() but that didn't help (mayy be wrong buffer stream?).
Ilya
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC