I'm trying to figure out how to handle the format of this file to be used with Dijkstra - type algorithm.
It is a simple text file, with an unknown number of lines (easily created function to...
Type: Posts; User: mikeman
I'm trying to figure out how to handle the format of this file to be used with Dijkstra - type algorithm.
It is a simple text file, with an unknown number of lines (easily created function to...
I tried last night, and it seems to me that you're alluding to using a pointer of sorts, so that I'm incrementing what is at a memory location? I haven't been able to properly implement it though.
I'm trying to get my binary tree to print out 10 things per line. I'm having issues though, as when the traversing reaches a leaf, on moving to the next printable node my counter is reset to one...
I suppose so, yes ;) I was just thinking that there was an internal way of doing it that didn't require writing a separate function. Or perhaps I was just looking for confirmation that I had to do...
I ended up just doing a workaround and using a loop to convert the strings to their ascii sums and comparing them that way.
I don't think that you are right in the use of < or >, at least not in the sense I'm asking about.
It will, from what I can tell, compare character by character. Once an inequality is found, it...
I'm attempting to compare two strings for use in insertion for a binary tree. I want to compare the strings similar to how integers are compared, I want the whole string compared, not character by...
.
..
Nevermind, the error is happening elsewhere.
Thanks for the help!
Ok, in the file, % precedes a command, say insert, end, print, etc, to be done on a linked list.
Here is what I did, but it's not working. Builds fine, but has error that doesn't allow it to run...
I'm not following too well.
I get the first part to use getline.
getline(infile, temp)
But I'm not too sure what you're meaning from here.
The name field should not contain whitespace. The whitespace should be a delimiting character. Which I've sort of tried to implement using get, but haven't been very successful.
As far as the...
How can I implement this using C++ syntax, instead of C?
Yes, it is a text file.
Specifically, it has a Name, then an ID.
John 123
James 456
Joel 135
I'm trying to read in a file which is formatted like so:
Char_Array Int
Char_Array Int
.
.
.
There is a single space in between the array and the int. How can I read in from this, and...
Hah duh, thanks.
I'm writing a simple LL search function, which will search through the linked list for a Name. If found, it will print out the Name and ID associated with the name, and continue searching.
I...
Would I be able to use strcpy to convert Next to char array like this?
string Next;
char Next2[size];
ifstream infile("A2.txt");
while (infile.good()) {
getline(infile,Next);...
Right. So I thought about using char Next[size] and in the infix to postfix function setting the input as char infix[size] so it would hold the length that I need. But I run into an error with using...
I'm writing code for an assignment for infix to postfix conversion using stack class and queue class. My conversion function I think needs to accept a character array, but I have set up in main to...
Got started on breaking it down but have to break till later, have a class to go to.
One issue I'm seeing and I think is due to type issues:
I load a char array with "ABCD" and load the first...
I'm writing an infix to postfix program. All has been slowly but surely going well, but now I'm actually running the program after getting rid of all warning and errors the compiler found, and...
edit: delete this post. Figured out problem.
I'm trying to find code that is used in the STL.
I have an assignment where we are to use stacks / queues, but he wants us to build the stack using a class and write our own functions for...
I figured it out.
Thank you all for all of the help you've given!