Wow I'm blind; I swapped where 0 and 1 should be.
Type: Posts; User: strakerc
Wow I'm blind; I swapped where 0 and 1 should be.
I'm in school, and this was the assignment; so I cannot change the data structure. Here is my code which may also help make more sense of things. I think it is close to being right, but some...
That's close, but the data structure isn't a normal 2D array and cannot be accessed like array[][]. It is two separate arrays of linked lists...I uploaded a picture to help explain what I mean. The...
So I need to detect symmetry between 2 arrays of linked lists. One array represents rows in a sparse matrix (a table where empty values do not exist and thus do not waste space) and the other...
I have completely rewritten my insert function, which has removed all bus errors. I now however cannot tell if either my print function is wrong, or the insert function isnt completely right as...
Do you mean node*? Yea I think you're right. Additionally I think I needed to malloc for the Matrix. I am getting the same bus error for invalid memory access all over the place...
Here is my main...
Hi all, so I'm trying to initialize 2 arrays of nodes as defined like:
struct Node
{
long rowIndex;
long columnIndex;
double value;
struct Node* rowPtr;
struct Node*...
Thanks. All you help got this working. Additionally, I needed () around *array.
I do catch the realloc failing, but I am still receiving "bus error". See my above post. Also, shouldn't I free the original array regardless and set it equal to resizedarray?
That makes sense, although for some reason I thought you were not allowed to just set an array equal to another: should I add free(original_array); ? Regardless, I did these suggestions and it...
I see. The loop was a simple mistake and understood. As for realloc, do this mean I need to declare a new char ** and set the realloc equal to it, ie
char ** resizedarray;
resizedarray =...
My goal is to load a char** from a file of words so that there is no wasted space (ie custom amount of cols for the exact amount of letters in each word). I am getting "bus error" when trying to run...