Is there a default buffer length for 'sprintf' method?
Posted
by Isuru
on Stack Overflow
See other posts from Stack Overflow
or by Isuru
Published on 2010-03-31T08:48:05Z
Indexed on
2010/03/31
8:53 UTC
Read the original article
Hit count: 454
Hi,
I used sprintf method to format data to a string which I want to write to a file, in C++ console application using VS 2008. The Input is a particular message, which has various variables and values (ex: Type 'int' and Value '10' / Type string and value "abc", etc.) When I send a two messages it works perfectly. But When I send more than two messages it gives a runtime error saying 0xC0000005: Access violation reading location 0xabababab. Why is this happening? Is it because the method 'sprintf' has a default buffer length? How can I overcome this problem?
© Stack Overflow or respective owner