Do this:
cout << setw(256) << left << pad << "data here" <<endl;
You may need #include <iomanip>
.
BTW in your "real code" you should use snprintf
to ensure there is no chance of a buffer overflow, assuming that your %s
is going to get some argument that's worked out at runtime . (Or preferably replace the sprintf
with a stringstream).