I have searched high and low for the answer to what I am sure is a simple mistake that I just can't put my finger on!
When using the %s argument with sprintf to pass a string of characters, the resulting output is unexpected and the rest of the argument calls are also corrupted. I have tried to specify the precision using something like %.4s to read four characters but the same thing happens.
I know I am going to kick myself for this one!
using namespace std;
testclass(string id, int firstnumber, int secondnumber, int thirdnumber);
testclass::testclass(string id, int firstnumber, int secondnumber, int thirdnumber)
sprintf_s(statement, "%s, %i, %i, %i", id, firstnumber, secondnumber, thirdnumber);
// statement should now say: "abcd, 1, 2, 3"
// statement actually says: "¸ý$, 1684234849 1537765632 44"
cout << statement;
new testclass("abcd", 1, 2, 3);