User Profile
Collapse
-
How do I use WebClient in C++?
I want to use WebClient in C++ in order to copy source from a webpage and save it into a text file. How do I do that? I have never used WebClient before. -
the size
The size is 0 bytes, I just checked. I don't understand how this is. -
The program now finishes running, but the text file returned is empty. Why does this happen?Leave a comment:
-
How would I do that though? I don't understand how to do this.Leave a comment:
-
VS2010 giving me Debug Assertion Failure in C++
Hello, I am having a problem running my program with libcurl,
What puzzles me is that this program works on Visual Studio 2010 on my computer running Windows XP, however when I try to run the same program on my laptop which runs Windows 7, it gives me the following error message:
Debug Assertion Failed!
Program: C:\Project\libc url\VisualStudi o\project1\Debu g\project1.exe
File: f:\dd\vctools\c rt_bld\self_x86 \crt\src\fwrite .c... -
C++, I want to write a date class
A few months ago I asked about this, and it seems this issue is still not resolved, so I'm asking for your help.
I want to write a date class that skips weekends and these holidays
a. New Year, Jan 1
b. MLK Jr Day, Jan 18
c. Washington's Birthday, Feb 15
d. Good Friday, Apr 2
e. Memorial Day, May 31
f. Independence Day, July 5 (observed)
g. Labor Day, Sep 6
h. Thanksgiving... -
-
Press Ctrl+F5 during debug
or add the following lines at the end before "return 0;":
char response;
cin >> response;Leave a comment:
-
Ok, I changed the main.cpp code for the output:
...Code:#include "dateclass.h" #include <iostream> using namespace std; int main() { dateclass current; cout << "Today: " << current.decrement(0) << endl; cout << "2 Days Ago: " << current.decrement(1) << endl; //compensate for skipping holidays cout <<Leave a comment:
-
I wasn't being rude. I am just saying, those functions seem to do the same thing. I really don't care about the time, I just need the date.Leave a comment:
-
Never mind about that. I did it how I did it. However, it does not seem to work.Leave a comment:
-
Why does my dateclass class gives the wrong date?
I have made a date program. I need it to do three things now:
1. Return the previous dates, (0, 1, 2, 3... Days ago)
2. Skip the weekends.
3. Skip these holidays:
New Year's Day (Jan 1)
MLKJ Day (Jan 18)
Pres. Day (Feb 15)
Good Friday (Apr 2)
Memorial Day (May 31)
Indep. Day (Jul 5 observed)
Labor Day (Sep 6)
Thanksgiving Day (Nov 25)
Christmas (Dec... -
C++, How do I overwrite a .txt file?
I am trying to overwrite an ifstream file with an ofstream file. How do I do this? -
How to get position of a search in the text file?
Hello, I have a bit of a problem here: I am trying to make the search find the positions of a string in the text file.
The .txt file is very large and the string comes up multiple times, so I need a way to delete part of the txt file up to the point I see the first occurence of the word
Here is my code:
...Code:#include <iostream> #include <iomanip> #include <fstream>
-
-
Why does this not compare 2 strings and how do I fix it?
This is a class in my code:
...Code:#include <string> typedef unsigned short ushort; using namespace std; class numvalue { private: ushort day; ushort month; ushort year; char number; string str_month; string curdate; public: numvalue(){}; ushort getmonth(string curdate) { -
How do you get a previous date in C++?
If you have the current date, how do you get the date 1 day or 2 days or 100 days back? -
C++, using Curl, code to copy source of webpage causes errors
Here is my code: What it has to do is convert the webpage source into a .txt file, but unfortunately it is causing exceptions. In case anyone asks, I am using Visual C++ 2010 Express.
Why is it not working?
The code:
...Code:#include "curl.h" #include "easy.h" size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream) { size_t written; written = fwrite(ptr, -
How to copy a source of a website using C++?
I want to copy a website that is already in source format; ie. the website is a source of another website.
How do I do this using C++? -
Ok, if I already have the source code of the page, how can I, using C++, save it to a .txt file?Leave a comment:
No activity results to display
Show More
Leave a comment: