Ask your own question, for FREE!
Computer Science 15 Online
OpenStudy (walters):

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</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; }</p> <time datetime="2013-02-03T18:29:07+00:00" class="dateposted">13 years ago</time> </div> <!-- UNDERDOGMEDIA InPage_questioncove.com ADCODE START--> <!--<div class="udm-inpage"> <script> try { top.udm_inpage_sid = 17116 } catch (e) { console.warn('Error initializing udm inpage. Please verify you are not using an unfriendly iframe') } </script> <script src="https://bid.underdog.media/inpageLoader.js"></script> </div>--> <!-- UNDERDOGMEDIA InPage_questioncove.com ADCODE END--> <!--<ins class="adsbygoogle" style="display:block" data-ad-format="fluid" data-ad-layout-key="-ff+6a-1o-cx+ts" data-ad-client="ca-pub-5451647361488902" data-ad-slot="5410687860"></ins> <script>(adsbygoogle = window.adsbygoogle || []).push({});</script>--> <div class="question reply signup-ad"> <div class="help-header">Still Need Help?</div> <div class="help-body">Join the QuestionCove community and study together with friends!</div> <div class="signup-button" onclick="location.href = '/?utm_source=updatespage&utm_campaign=signups&utm_medium=inbetweensignupbutton'">Sign Up</div> </div><input type="hidden" name="IL_IN_ARTICLE"><div id="udm-video-content" style="width: auto; display: block; margin: auto; background-color: black;"></div><div class="question reply" id="510eac8fe4b0d9aa3c47a321" > <img class="avatar" src="/images/default-avatar.svg" alt> <span class="question-replier">OpenStudy (walters):</span> <p class="reply body"></p> <time class="dateposted" datetime="2013-02-03T18:29:35+00:00">13 years ago</time> </div> <div class="question reply" id="510eade3e4b0d9aa3c47a35e" > <img class="avatar" src="/images/default-avatar.svg" alt> <span class="question-replier">OpenStudy (walters):</span> <p class="reply body">actualy my problem is that getenv give me the warnings</p> <time class="dateposted" datetime="2013-02-03T18:35:15+00:00">13 years ago</time> </div> <div class="question reply" id="510eafaee4b0d9aa3c47a3b5" > <img class="avatar" src="/images/default-avatar.svg" alt> <span class="question-replier">OpenStudy (konradzuse):</span> <p class="reply body">you should really do what someone asks you to when they are helping you.</p> <time class="dateposted" datetime="2013-02-03T18:42:54+00:00">13 years ago</time> </div> <div class="question reply" id="510eb012e4b0d9aa3c47a3c8" > <img class="avatar" src="/images/default-avatar.svg" alt> <span class="question-replier">OpenStudy (konradzuse):</span> <p class="reply body">if( getenv("CONTENT_LENGTH") ) contentLength= atoi(getenv("CONTENT_LENGTH")); what is "CONTENT_LENGTH" "getenv" and atoi?</p> <time class="dateposted" datetime="2013-02-03T18:44:34+00:00">13 years ago</time> </div> <div class="question reply" id="510eb097e4b0d9aa3c47a3e6" > <img class="avatar" src="/images/default-avatar.svg" alt> <span class="question-replier">OpenStudy (walters):</span> <p class="reply body">atoi it convert string to integer</p> <time class="dateposted" datetime="2013-02-03T18:46:47+00:00">13 years ago</time> </div> <div class="question reply signup-ad"> <div class="help-header">Still Need Help?</div> <div class="help-body">Join the QuestionCove community and study together with friends!</div> <div class="signup-button" onclick="location.href = '/?utm_source=updatespage&utm_campaign=signups&utm_medium=inbetweensignupbutton'">Sign Up</div> </div><div class="question reply" id="510eb8c5e4b09cf125bce6e2" > <img class="avatar" src="/images/default-avatar.svg" alt> <span class="question-replier">OpenStudy (anonymous):</span> <p class="reply body">I just compiled your program with g++, but I got no warnings. Could you post the ones that you get?</p> <time class="dateposted" datetime="2013-02-03T19:21:41+00:00">13 years ago</time> </div> <div class="question reply signup"> <a href="/?utm_source=updatespage&utm_campaign=signups&utm_medium=bottomsignupbutton" class="signupreply">Click Here to Signup and join the QuestionCove Community!</a> </div> </div> <div id="right-container"> <div class="cant-find-answer"> <span class="cant-find-mobile-head">Can't find your answer?</span> <span class="cant-find-mobile-body">Make a FREE account and ask your own questions, OR help others and earn volunteer hours!<br><br>Join our real-time social learning platform and learn together with your friends!</span> <button class="cant-find-sign-up" onclick="location.href = '/?utm_source=updatespage&utm_campaign=signups&utm_medium=upsellsignupbutton'">Sign Up</button> </div> <div id="ask-a-question"> <textarea id="ask-a-question-text" placeholder="Need more help? ask your own questions for FREE!" maxlength="2500"></textarea> <button id="submit-question" onclick="askQuestion()">Ask Question</button> </div> <!--<input type="hidden" name="IL_IN_ARTICLE">--> <div class="sim-questions latest"> <span class="sim-question-head">Latest Questions</span> <div class="sim-question"> <img class="avatar" src="/assets/users/heartlessprophet/avatar/small?1789512202" alt><span class="question-replier sim-question-poster">heartlessprophet:</span> <a href="6aa9c816532dddbed1292000" class="reply body sim-question-text">Aye what's 19z%u00f74p=9u03c0 my teacher thinking of impossible questions for us </a> <div class="sim-question-details"> <span class="sim-question-detail">18 minutes ago</span> <span class="sim-question-detail">0 Replies</span> <span class="sim-question-detail">0 Medals</span> </div> </div> <div class="sim-question"> <img class="avatar" src="/assets/users/kippppp/avatar/small?1789485636" alt><span class="question-replier sim-question-poster">kippppp:</span> <a href="6aa96d5313937eef98225500" class="reply body sim-question-text">does anyone have any good tips for writing stories? i'm trying to write a dnd campaign but i'm not that great of a writer yet.</a> <div class="sim-question-details"> <span class="sim-question-detail">5 hours ago</span> <span class="sim-question-detail">5 Replies</span> <span class="sim-question-detail">1 Medal</span> </div> </div> <div class="sim-question"> <img class="avatar" src="/assets/users/grizzley19/avatar/small?1789269281" alt><span class="question-replier sim-question-poster">GRIZZLEY19:</span> <a href="6aa8bf9c3bc43a284233e200" class="reply body sim-question-text">Y'all let me know what y'all think about this beat I made I took me like a hour maybe rate it 0/10 https://drive.</a> <div class="sim-question-details"> <span class="sim-question-detail">19 hours ago</span> <span class="sim-question-detail">0 Replies</span> <span class="sim-question-detail">0 Medals</span> </div> </div> <div class="sim-question"> <img class="avatar" src="/assets/users/ultrilliam/avatar/small?1788273971" alt><span class="question-replier sim-question-poster">Ultrilliam:</span> <a href="6aa83368c86ed105795b880" class="reply body sim-question-text">Welcome to the 10th Anniversary Update! (Part 2) Sorry this one passed the date a</a> <div class="sim-question-details"> <span class="sim-question-detail">1 hour ago</span> <span class="sim-question-detail">15 Replies</span> <span class="sim-question-detail">4 Medals</span> </div> </div> <div class="sim-question"> <img class="avatar" src="/assets/users/twaylor/avatar/small?1747069984" alt><span class="question-replier sim-question-poster">Twaylor:</span> <a href="6aa8328b6bb551cd22ab5400" class="reply body sim-question-text">was walking downtown and my adhd brain wanted to make some (rock?) lyrics: There'</a> <div class="sim-question-details"> <span class="sim-question-detail">2 hours ago</span> <span class="sim-question-detail">6 Replies</span> <span class="sim-question-detail">0 Medals</span> </div> </div> <div class="sim-question"> <img class="avatar" src="/assets/users/andrew2002/avatar/small?1789481417" alt><span class="question-replier sim-question-poster">AndreW2002:</span> <a href="6aa808055b238e711c6d8400" class="reply body sim-question-text">There is an error when sending GIFs, is this known or is this a level requirement</a> <div class="sim-question-details"> <span class="sim-question-detail">1 day ago</span> <span class="sim-question-detail">10 Replies</span> <span class="sim-question-detail">0 Medals</span> </div> </div> <div class="sim-question"> <img class="avatar" src="/assets/users/serenitystxrgazer/avatar/small?1780325377" alt><span class="question-replier sim-question-poster">serenitystXrgazer:</span> <a href="6aa735d51f20e9501e430c00" class="reply body sim-question-text">Getting sent to anti gay christian covestion camp in a few weeks, any tips. guys i think im cooked.</a> <div class="sim-question-details"> <span class="sim-question-detail">5 hours ago</span> <span class="sim-question-detail">10 Replies</span> <span class="sim-question-detail">1 Medal</span> </div> </div> <div class="sim-question"> <img class="avatar" src="/assets/users/aubree/avatar/small?1773446714" alt><span class="question-replier sim-question-poster">Aubree:</span> <a href="6aa4dd917827807162476000" class="reply body sim-question-text">Guys, what does love feel like? I've been getting a tight chest and when I talk to him my heart rate hangs out around 100-120 beats per min, and when he doe</a> <div class="sim-question-details"> <span class="sim-question-detail">2 days ago</span> <span class="sim-question-detail">10 Replies</span> <span class="sim-question-detail">2 Medals</span> </div> </div> <div class="sim-question"> <img class="avatar" src="/assets/users/thereneelg/avatar/small?1787601829" alt><span class="question-replier sim-question-poster">thereneelg:</span> <a href="6aa33d0c7072384b078e3c00" class="reply body sim-question-text">ok... anyone have advice?? ...I did Choir all throughout Middle school and have ALWAYS been put in Soprano those three years.</a> <div class="sim-question-details"> <span class="sim-question-detail">4 days ago</span> <span class="sim-question-detail">6 Replies</span> <span class="sim-question-detail">1 Medal</span> </div> </div> <div class="sim-question"> <img class="avatar" src="/assets/users/kamariana/avatar/small?1789333340" alt><span class="question-replier sim-question-poster">kamariana:</span> <a href="6aa2e56c3e187aa4f1dff400" class="reply body sim-question-text">The Byzantine Procopius is known for (5 points) reconquering much of the old Roma</a> <div class="sim-question-details"> <span class="sim-question-detail">5 days ago</span> <span class="sim-question-detail">0 Replies</span> <span class="sim-question-detail">0 Medals</span> </div> </div> </div> </div> </div> </div> <div id="blackback"></div> <div id="leave-popup"> <div class="cant-find-answer"> <button class="cant-find-mobile-close" title="close" onclick="qc.toggleSideBar();"></button> <span class="cant-find-mobile-head">Can't find your answer?</span> <span class="cant-find-mobile-body">Make a FREE account and ask your own questions, OR help others and earn volunteer hours!<br><br>Join our real-time social learning platform and learn together with your friends!</span> <button class="cant-find-sign-up" onclick="location.href = '/?utm_source=updatespage&utm_campaign=signups&utm_medium=popupsignupbutton'">Sign Up</button> </div> </div> <script> var questionVal = "c++ question can u pls run this code and help me to remove the warnings\n\n#include<iostream>\n#include<string>\n#include<cstdlib>\nusing namespace std;\n\nint main()\n{\n\tchar postString[1024]=\"\";\n\tstring dataString =\"\";\n\tstring nameString =\"\";\n\tstring passwordString=\"\";\n\tint contentLength=0;\n\n\n\tif( getenv(\"CONTENT_LENGTH\") )\n\t\tcontentLength= atoi(getenv(\"CONTENT_LENGTH\"));\n\tcin.read(postString,contentLength);\n\tdataString = postString;\n\n\tint namelocation = dataString.find(\"namebox=\")+8;\n\tint endNamelocation = dataString.find(\"&\");\n\tint password = dataString.find(\"passwordbox=\")+12;\n\tint endPassword = dataString.find(\"&button\");\n\n\tnameString = dataString.substr(namelocation,endNamelocation-namelocation);\n\tpasswordString=dataString.substr(password,endPassword-password);\n\n\tcout<<\"content-Type:texthtml\\n\\n\";\n\n\tcout<<\"<?xml version = \\\"1.0\\\"?>\"\n\t\t<<\"<!DOCTYPE html PUBLIC\\\"-\/\/W3C\/\/DTD XHTML 1.1\/\/EN\\\"\"\n\t\t<<\"\\\"htp:\/\/www.w3.org\/TR\/xhtml11\/DTD\/xhtml11.dtd\\\">\";\n\n\tcout<<\"<html xmlns =\\\"http:\/\/www.w3.org\/1999\/xhtml\\\">\"\n\t\t<<\"<head><title>Bug2Bug Travel<\/tittle><\/head><body>\";\n\n\tif (passwordString == \"coat2coat\")\n\t\tcout<<\"<hr\/><p>Currnt member special:\"\n\t\t<<\"Seattle to Tokyo ($400)<\/p>\";\n\telse \n\t\tcout<<\"<p>sorry u have entered incorrect password<\/p>\";\n\tcout<<\"<\/body><\/html>\";\n\treturn 0;\n}"; var questionId = "510eac73e4b0d9aa3c47a317"; </script> <script src="/javascripts/jquery.min.js" defer></script> <script src="/javascripts/updates.js?v1.4.7" defer></script> <script src="/javascripts/placeholder.js" defer></script> <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" defer> <!--<script type="text/javascript"> var infolinks_pid = 3241206; var infolinks_wsid = 0; </script> <script data-cfasync="false" language="javascript" async src="https://udmserve.net/udm/img.fetch?sid=15754;tid=1;dt=6;"></script> <script type="text/javascript" src="//resources.infolinks.com/js/infolinks_main.js"></script>--> <div data-sc="MzkwYWUwNjA4NDg1ODk1ZDo3NDBiOWRlODZlNzEzZTI3OGNmZjJjYzcwNzMyYjdjNg==" style="display:none"></div> <script src="/javascripts/sc-engine.js?09.15.2026.v1" async defer></script> <script> (function(){ var config = document.querySelector('[data-sc]'); var deadline = 0; var attempts = 0; var token = ''; function status(value) { if (config) config.setAttribute('data-sc-sync', value); } function send() { attempts++; status('sending'); var x = new XMLHttpRequest(); x.open("POST", "/ajax_request/", true); x.timeout = 10000; x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); x.onloadend = function() { if (x.status >= 200 && x.status < 300) { status('complete'); } else if (attempts < 3 && (x.status === 0 || x.status === 408 || x.status === 429 || x.status >= 500)) { status('retrying'); setTimeout(send, attempts * 1000); } else { status('failed'); } }; x.send("sc_anon=1&sc_token=" + encodeURIComponent(token)); } function collect() { if (!window.SCEngine) { if (Date.now() < deadline) setTimeout(collect, 250); else status('engine-unavailable'); return; } status('collecting'); SCEngine.collectSigned().then(function(value) { if (!value) { status('unavailable'); return; } token = value; send(); }).catch(function(){ status('unavailable'); }); } function start() { status('waiting'); deadline = Date.now() + 15000; setTimeout(collect, 2000); } if (document.readyState !== "loading") start(); else document.addEventListener("DOMContentLoaded", start, { once: true }); })(); </script> </body> <html>