Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

walters Group Title

c++ question can u pls run this code and help me to remove the warnings #include<iostream> #include<string> #include<cstdlib> 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<<"<?xml version = \"1.0\"?>" <<"<!DOCTYPE html PUBLIC\"-//W3C//DTD XHTML 1.1//EN\"" <<"\"htp://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"; cout<<"<html xmlns =\"http://www.w3.org/1999/xhtml\">" <<"<head><title>Bug2Bug Travel</tittle></head><body>"; if (passwordString == "coat2coat") cout<<"<hr/><p>Currnt member special:" <<"Seattle to Tokyo ($400)</p>"; else cout<<"<p>sorry u have entered incorrect password</p>"; cout<<"</body></html>"; return 0; }

  • one year ago
  • one year ago

  • This Question is Closed
  1. walters Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    • one year ago
    1 Attachment
  2. walters Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    actualy my problem is that getenv give me the warnings

    • one year ago
  3. KonradZuse Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    you should really do what someone asks you to when they are helping you.

    • one year ago
  4. KonradZuse Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    if( getenv("CONTENT_LENGTH") ) contentLength= atoi(getenv("CONTENT_LENGTH")); what is "CONTENT_LENGTH" "getenv" and atoi?

    • one year ago
  5. walters Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    atoi it convert string to integer

    • one year ago
  6. slotema Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    I just compiled your program with g++, but I got no warnings. Could you post the ones that you get?

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.