What do you mean "better"?
It's tough to beat the simplicity of 5 characters of source code of <<" "
There's no end of contrived methods which take much longer to type, and don't necessarily add any clarity.
Code:
#include <iostream>
#include <iomanip>
#include <cstring>
using namespace std;
int main()
{
char name[] = "Abhi";
int age = 17 ;
cout << left << setw(strlen(name)+1) << name << age << endl;
return 0;
}
You could use regular c-style printf() if you wanted.
Or even something which looks a bit like printf format strings, with the added benefit of C++ type safety.
Type-safe 'printf-like' format class - 1.67.0
Extremely Efficient Type-safe printf Library - CodeProject