Never mind, fixed it.
Type: Posts; User: 9erNumber16
Never mind, fixed it.
Not sure what I'm doing wrong. Here is the error message:
main.cpp:32: undefined reference to `FindPath::FindPath(Graph&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
...
Ah, I think I understand. Come to think of it, I did have a couple name collisions I had to fix. Thanks again.
Ok, got it working. Thanks for the replies. Now I just have to figure out what to do with my vertices method. Out of curiosity, why is putting "using namespace std" in the header bad practice?
I'm using a while loop like this: (while myFile.good()). I figured I needed another for the rest of the line. Here's what I tried:
while(myFile.good())
{
getline(myFile,line,...
We're doing the "How Close to Kevin Bacon" problem in class. To do it, we are building a graph using maps and sets. I'm still new to C++, and am having problems with the very beginning (reading the...
Wow... it's so beautiful... In my defense, I did try something similar to that using a while loop (unsuccessfully, obviously). I think this whole thread is a pretty strong testament that I need to...
My pop function does return it, but then the size got smaller with each iteration, so I was only printing half the values. Somebody else mentioned the intStack, and now I see the reason. And wow,...
Yeah, I realized that's why I wasn't getting the right results. Too bad C doesn't have a standard iterator built in...
Also, I read the assignment wrong, and I don't have to pop in the printStack, so I'm guessing I'll need an iterator.
You were right, I needed to initialize it, but I was thinking in C++ and Java terms and it was messing me up. Here's what I have now:
#include <stdio.h>
#include <string.h>
#include...
Ok, never mind on that. I'm an idiot, still adjusting to C syntax. It is still leaving one number out, but I think I might be able to handle that. Thanks.
For some reason, whenever I initialize count = 0, it says stack has no member 'count.' And I agree about the printStack not popping, but for some reason that is what the assignment calls for. If I...
Ok, handled that. But it's still giving count as a memory location instead of an int.
I'm learning about structs in C, so we were assigned to implement a stack using a singly linked list. Whenever I try to print the stack, it prints the values I input, then says there is an error. I...