Hey all,
I'm stumped! How do I convert
char X to std::string sob (see below)?
Code:
#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <fstream.h>
main(){
FILE *OB2;
char x[5];
cin>>x[5];
obCheck:
std::fstream OB;
OB.open("./oob", std::ios::in);
std::string sob(x);
while (!OB.eof()){
cout<<sob<<endl;
std::getline(OB, sob);
}
OB.close();
cout<<sob<<endl;
if (x=sob){
cout<<"Unit name already used. Please enter another name"<<endl;
cin>>x;
goto obCheck;
}
else{
}
}
THX