So I want to check to see if the command line argument I received was an integer. How do I do this?
#include <iostream>
using namespace std;
int main(int argc, char* argv[]) {...
Type: Posts; User: Jozrael
So I want to check to see if the command line argument I received was an integer. How do I do this?
#include <iostream>
using namespace std;
int main(int argc, char* argv[]) {...
Edit: Foot in mouth x2?
EDIT: I'm a retard. Fixed. lol.
I'm fairly sure its memory corruption. I have a map of strings and a class called 'page' (i'm simulating a web crawler) and I just found out that none of the info is actually being stored in the map...
Sigh heh. Ok, now I'm getting segfaults. My intuition (which is often wrong as a novice programmer) tells me that it has to do with the fact that I'm calling this Crawl function from within...
What do you prefer to use? is there like an 'alternate STL'? Or do you just code it all from scratch yourself @_@?
Yes it is.
I can't even begin to comprehend the line of code mir posted, haha.
EDIT: I know about second pages, totally :\.
Thanks elysia, worked like a charm =).
Yes it is.
I cant even begin to understand the line of code mir posted, heh.
Ah ha, another questions ><. I'm trying to declare another in file stream, and its in a function outside of the main.
bool Crawl(blah) {
...
for (int i = 0; i < hyperlinks.size();...
Oh right, now that you told me how to use it, I can go back to my old loop. lol
Thanks guys!
Hrm, I'm missing something here. Its probably a preprocessor directive but the ones I'm finding on google arent doing me any good.
I have:
string word = "Blah";
word = tolower(word);
Thanks, ' instead of " worked perfectly.
Another question ><. How to easily transform strings into lowercase? I hear theres a function StringToLower, but I cant seem to get my program to...
How do I parse a "?
For example, I'm supposed to be coding a web crawler for this homework, and hyperlinks are enclosed in quotes. How do I do a
string word;
//code to fill in word
if...
Well, I found an odd workaround to the problem, but I'm still not sure why it didn't work in the first place =\. I'll post it later (once I've met the deadline) so I can find out what I was doing...
No, we're only allowed to use classes in this course. And this is how I setup my program.
As to the segfault, I found some interesting information via some debugging cout statements...my memory...
Alright, well, I 'solved' the first problem by throwing a whole series of classes into the equation. It works fine, except for the fact that I'm getting a segfault while running my program (its...
First problem fixed, segfault problem below.
<Ignore>Ok, so for my assignment, I need a list of list of list of ints. We're working with lists this week, so more elegant data structures...
Alright, I'm much clearer about why I shouldn't have 'using blah' in my header files, thank you for your help.
I was confusing the #include and the using for the vector, thank you. I'm just...
Thanks for your reply.
1: I prefer to name classes with capitals, but they provided a main.cpp file for us to use, and it used constructors named 'user', so I went with it. Thanks for the tip...
But I want a vector of ads, a specific class I've declared in another .h and .cpp file. Thank you for your response, if I can give you any more information to help you, please tell me.
g++ main.cpp user.cpp ad.cpp
user.h:29: error: ISO C++ forbids declaration of 'vector' with no type
user.h:29: error: expected ';' before '<' token
Here is my user.h file:
#ifndef _user_h_...