c++ question can u pls run this code and help me to remove the warnings
#include
#include
#include
using namespace std;
int main()
{
char postString[1024]="";
string dataString ="";
string nameString ="";
string passwordString="";
int contentLength=0;
if( getenv("CONTENT_LENGTH") )
contentLength= atoi(getenv("CONTENT_LENGTH"));
cin.read(postString,contentLength);
dataString = postString;
int namelocation = dataString.find("namebox=")+8;
int endNamelocation = dataString.find("&");
int password = dataString.find("passwordbox=")+12;
int endPassword = dataString.find("&button");
nameString = dataString.substr(namelocation,endNamelocation-namelocation);
passwordString=dataString.substr(password,endPassword-password);
cout<<"content-Type:texthtml\n\n";
cout<<""
<<"";
cout<<""
<<"Bug2Bug Travel";
if (passwordString == "coat2coat")
cout<<"
Currnt member special:"
<<"Seattle to Tokyo ($400)
";
else
cout<<"
sorry u have entered incorrect password
";
cout<<"";
return 0;
}
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
OpenStudy (walters):
OpenStudy (walters):
actualy my problem is that getenv give me the warnings
OpenStudy (konradzuse):
you should really do what someone asks you to when they are helping you.
OpenStudy (konradzuse):
if( getenv("CONTENT_LENGTH") )
contentLength= atoi(getenv("CONTENT_LENGTH"));
what is "CONTENT_LENGTH"
"getenv"
and atoi?
OpenStudy (walters):
atoi it convert string to integer
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
OpenStudy (anonymous):
I just compiled your program with g++, but I got no warnings. Could you post the ones that you get?