Hi,
I am having diffuculty with 2D arrays and printf, I am using a 3*17 array to store 3 strings 17 characters long. When I use printf it prints all 3 strings e.g.
The desired output would be someting likeCode:for(j=0;j<3;j++) printf("error: %s\n",error[j]);
error: 100000000000000000
error: 010000000000000000
error: 001000000000000000
However I get,
The desired output would be someting like
error: 10000000000000000001000000000000000000100000000000 0000
error: 010000000000000000001000000000000000
error: 001000000000000000
Any ideas what causes this and how to get what I want,
Cheers
I have a simaler problem with fprintf.



LinkBack URL
About LinkBacks


