No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
6 Posted Topics
I'm trying to recursively search through directories and pull out any files or subdirectories. This is the code I have: [code=cplusplus] int readDir(string directory, vector<string> &fileList) //directory is the name of a direcotry //fileList is an empty vector DIR *dir; struct dirent *ent; if((dir = opendir(director.c_str()) == NULL){ cout<<"Invalid Directory"<<endl; … | |
I'm trying to go through a directory and put all of the files into a vector of strings. My problem is that the name of the file is stored, but not its location. Because of this, when I go to open the file later in another function, it doesn't recognize … | |
Can someone please explain how to create a makefile? I'm somewhat confused by what I've read on the web thanks | |
Anyone know how to pass an entire hashmap to a function?? The hashmap is hash_map<string, wordStruct> hashofwords; wordStruct contains information about each word in the hashmap. | |
Can someone please give me an example of how to use .find() with a hashmap? This is what I have: (wordData is a struct with info about each word, and hashFunc is the name of the hash function) typedef hash_map<string,wordData,hashFunc> wordHash; wordHash hashofwords; (after passing in a string s to … | |
I have a text file that in some places have newlines in the middle. For example: My name is Sam. I am a novice programmer. I go to school in Michigan. I use getline() to read through the entire file, and then I send it to a function to tokenize … |
The End.