Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Course Queries Syllabus Queries 2 years ago
Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I'm trying to get the html source of a webpage www.chemguide.co.uk (it has pages that aren't miles long) using winsock implemented in c++. Most of the data that comes through is good, but at certain points in the output there is a certain character (it looks like |¦ on the console and some sort of I on here) being repeated, I think in groups of 8, and there are some other strange characters as well.
Also, some of the document seems to be printed after the end of the page (the tag. Here's the code:
// Portprog.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include #include #include #include #include #include #pragma comment(lib, "ws2_32.lib") //Winsock library int getHTML(std::string *result) { WSADATA wsa; SOCKET s; SOCKADDR_IN server; using std::string; using std::cout; using std::endl; cout << "Initialising Winsock..."; if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0) { cout << "Failed. Error Code: " << WSAGetLastError(); return 1; } cout << "Winsock initialised." << endl; if ((s = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { cout << "Could not create socket: " << WSAGetLastError() << endl; return 1; } cout << "Socket created." << endl; server.sin_addr.s_addr = inet_addr("217.27.240.124"); server.sin_family = AF_INET; server.sin_port = htons(80); //host to network endian short //Connect to remote server if (connect(s, (SOCKADDR *)&server, sizeof(server)) < 0) { cout << "Connection failed." << endl; return 1; } cout << "Connected." << endl; //Send some data string srequest = "GET / HTTP/1.1\r\n"; srequest += "Host: chemguide.co.uk\r\n"; srequest += "Connection: close\r\n"; srequest += "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n"; srequest += "\r\n"; char crequest[10000]; int requestSize = srequest.length() + 1; strncpy_s(crequest, REPLY 0 views 0 likes 0 shares Facebook Twitter Linked In WhatsApp
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Course Queries 4 Answers
Course Queries 5 Answers
Course Queries 1 Answers
Course Queries 3 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.