Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

walters

  • one year ago

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; }

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

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

    actualy my problem is that getenv give me the warnings

  3. KonradZuse
    • one year ago
    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.

  4. KonradZuse
    • one year ago
    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?

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

    atoi it convert string to integer

  6. slotema
    • one year ago
    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?

  7. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Ask a Question
Find more explanations on OpenStudy

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.