Yea, its not a habit of mine but I only posted it over there when no replies came in after several hours of the topic being up here. I just assumed no one would answer.
Type: Posts; User: klawson88
Yea, its not a habit of mine but I only posted it over there when no replies came in after several hours of the topic being up here. I just assumed no one would answer.
Thanks for your help Elysia. I've made your specified changes. That, along with the fact that the line right before the return in storeLine should have been
pwalker -= (length-1)
...seems to...
EDIT: Changed some of the code around.
Doing K&R exercise 5.13... which is supposed to take any amount of input lines and then print the last "n" lines. They wanted dynamic storage which is weird...
Ok, but what exactly is the name "example" pointing to? Dereferencing it iis either giving me a garbage value or a memory address (I can't tell).
And how does dereferencing anything give you an...
Woops... brain fart. How could I miss something so obvious! Thanks. I however, have another question concerning multi-dimensional arrays and pointers.
Suppose we have a 2-D array "example"
...
Hi,
So I'm doing the K&R book chapter on pointers. This isn't the first time i've learned about the topic, so reading it has given me what I thought was a good grasp on the topic. However, one of...
Ah! Looks like the gods of C have an error in their book!
Thanks... it was driving me crazy.
Hi,
I'm having a problem with one of the sample programs in the K&R book (second edition). Its the calculator program in chapter 4.
A good portion of questions in that chapter revolve around...
AH! It all makes sense now!
Sharke, the way you explained it is fantastic!
Thanks to everyone for their help.
What? Shouldn't indicator[0] be replaced with "indicator" then (if "indicator" is pointing to the first char in the array, and i'm looking for that)? Why would it be indicator[0]?
So would this be correct? I'm trying to get the first character in the indicator and hash it:
int hash (int num, char *indicator)
{
int ascii = indicator[0];
return ascii%num;
}
I don't understand. If it is of type "pointer to char" (one character), how exactly are you able to manipulate it like a string (multiple characters)?
My professor is having us define methods (which he has provided the headers for), and they take in:
char *indicator
as a parameter.
This is a pointer named "indicator" of type char......
Using that cast causes the code not to compile.... "error C2296: '^' : illegal, left operand has type 'unsigned int *' "
Ugh... why do I have a feeling that i'm missing something simple?
It's an HW assignment... and my professor told us to use the (unsigned int) typecast.
I'm just REALLY confused about what happens when I do the operation and how I can get a node from it.
So...
Ok, I get the basic concept of an XOR linked list... but I have a couple of questions concerning manipulation of the list.
1. How would you remove the head or tail? I'm familiar with Java, so what...