Fighting sprint ... something stupid?

Sorry to pester everyone, but it caused me some pain. Here is the code:

char buf[500];
sprintf(buf,"D:\\Important\\Calibration\\Results\\model_%i.xml",mEstimatingModelID);

mEstimatingModelID is an integer currently storing the value 0.

Simple enough, but debugging shows that this is happening:

0x0795f630 "n\Results\model_0.xml"

those. it skips the beginning of the line.

Any ideas? This is simple stuff, but I can't figure it out.

Thank!

+5
source share
1 answer

To make this a real general answer: Here is a checklist for similar errors:

  • , , , . , , - , , , . ( ) , VS (, b/c , , , 64bitness - )

  • , . "buf" , . /.

  • . - % s sprintf, .

  • . sprintf , , , , ..

+3

All Articles