M
Mark
I want to replace the following line:
sscanf(mybuf,"%s=%s\n",sz1,sz2);
with something that produces the same effect, only with
dynamic storage i.e string s which is safer.
I might try this:
sscanf(mybuf.c_str(),"%s=%s\n",string1.c_str(),string2.c_str());
but unsuprisingly this causes an error at runtime since there is nothing to
stop a memory overrun happening.Additionally there is no compile time check
as sscanf uses varargs.
Can anyone recommend the quickest way of acheiving this, short of writing
my own parser.
Mark
sscanf(mybuf,"%s=%s\n",sz1,sz2);
with something that produces the same effect, only with
dynamic storage i.e string s which is safer.
I might try this:
sscanf(mybuf.c_str(),"%s=%s\n",string1.c_str(),string2.c_str());
but unsuprisingly this causes an error at runtime since there is nothing to
stop a memory overrun happening.Additionally there is no compile time check
as sscanf uses varargs.
Can anyone recommend the quickest way of acheiving this, short of writing
my own parser.
Mark