M
Mr. Ken
In my function, my main calls a function to save the data. In script-based
languages like
matlab, I can use multiple in strcat. However, in C++ it's not working since
first argument
of strcat must be the destination.
How can I get arround?
main{
.....
fname = "_0100_0211"; // from somewhere
save_messages(......, char fname);
.....
return (0);
}
function save_messages(......, char fname[100])
{
fname = strcat("MSG_INP_", fname, ".DAT");
fp = fopen(fname, "w");
blah blah
fclose(fp);
fname = strcat("MOD_OUT_", fname, ".DAT");
fp = fopen(fname, "w");
blah blah
fclose(fp);
.....
....
}
languages like
matlab, I can use multiple in strcat. However, in C++ it's not working since
first argument
of strcat must be the destination.
How can I get arround?
main{
.....
fname = "_0100_0211"; // from somewhere
save_messages(......, char fname);
.....
return (0);
}
function save_messages(......, char fname[100])
{
fname = strcat("MSG_INP_", fname, ".DAT");
fp = fopen(fname, "w");
blah blah
fclose(fp);
fname = strcat("MOD_OUT_", fname, ".DAT");
fp = fopen(fname, "w");
blah blah
fclose(fp);
.....
....
}