There is no single standard function for this.
C++ (and C) were supposed to be platform-independent, but features like these call for platform-specific solutions. You need to know the dimensions of your console for instance and to get this, every operating system has its own solution.
You would need something like this:
- platform-dependent API to get the width of the console where you output the standard output
- calculate the length of the text (should be string.size())
- platform-dependent API to position your cursor
- put the cursor at (width - length) / 2 and print out the text.