What "hangs"? The compile?
You need some headers to access the string and ostringstream types:
Code:
#include <string>
#include <sstream>
using namespace std;
If you must use old school C++ then use ostrstream:
Code:
#include <iostream.h>
#include <strstrea.h>
...
ostrstream ostr;
int ip[4] = {0,0,0,0};
char *password = "*";
ostr << "net use * \\\\"
<< ip[0] << '.' << ip[1] << '.' << ip[2] << '.' << ip[3]
<< "\\c$ " << password << " /user:administrator" << ends;
cout << ostr.str() << endl;
I suggest you use/learn the current standard.
gg