PHP Code:
#include <iostream.h>
#include <windows.h>

//using namespace std;

int main()
{
    
UINT i;
    
char path[MAX_PATH];
    
UINT sz MAX_PATH;
    
GetWindowsDirectory(pathsz); 

    if (
i==ERROR_SUCCESS) {
        
cout << path << endl;
        
// you got it --- path is a null terminated string
    
}
    else {
        
cout << "error" << endl;
        
//something bombed.... not very likely with this call
        //call GetLastError to see what happened
    


    return 
0;


keeps outputting "error"

If I say if(i != ERROR_SUCCESS), I get the correct path.