StackOverflow is your friend (less than a minute searching):
http://stackoverflow.com/questions/11587426/get-current-username-in-c-on-windows
Includes:
<iostream>
<windows.h>
<Lmcons.h>
<SFML/Window.hpp>
"GDCpp/CommonTools.h"
"TextObject/TextObject.h"
Code:
[code]char username[UNLEN+1];
DWORD username_len = UNLEN+1;
GetUserName(username, &username_len);
std::vector<RuntimeTextObject*> textObjects = GetSpecificObjects(objectsList);
for(unsigned int i=0; i<textObjects.size(); i++){
textObjects[i]->SetString(username);
}[/code]
(With a text object pass for debug) At least it works for me!