First of all, what is s ?
a string? or a char *?
Furthermore, a variable definition in a for loop isn't valid C++ either (although it will compile)
string s;
int i;
int n=100;
for (i=1; i<=n; i++) {
stringstream ss;
i>>ss;
s<<ss;
s+=",";
}
I *think* that might work, although I don't really use those std things a lot