I fixed my errors for add a character and delete a character:
f = linkedListStrings[indexValue];
needed to be:
front = f = linkedListStrings[indexValue];
for both methods and now they...
Type: Posts; User: drater
I fixed my errors for add a character and delete a character:
f = linkedListStrings[indexValue];
needed to be:
front = f = linkedListStrings[indexValue];
for both methods and now they...
My insert character method seems to delete the index of the linked list that I want to manipulate. I don't free anything in it though... Can anyone see anything that I am doing wrong?
I fixed all of my index pointer warnings a better way, and added 2 other methods that don't seem to be working correctly. I am having trouble deleting characters from a specified position and adding...
if(f != NULL)
{
node3->next = temp;
node3 = node3->next;
}
so if f is null don't set the value the next node which makes it null
I was getting warning messages when I didn't have a pointer to the index. That got rid of warning.
#include <stdio.h>
#include <stdlib.h> // needed for malloc, free
struct node { // a node in the linked list
char data;
struct node *next;
};
int menu(void); // display list of...
I edited my previous post where I had posted my code. Even though I have a printf statement to print the list at the given location that they requested, It does not print anything. It does return me...
I meant it doesn't display Love instead of programming. Instead it just freezes.
#include <stdio.h>
#include <stdlib.h>
struct node
{
char data;
struct node *next;
};
Yeah it's not really a lesson on how to use a linked list well and efficiently, its just a lesson on how to use it.
So now that I can add things to my list and have null nodes separating them, I want it so if a person says they want to output the string at index 1, for the list:...
Works great, thank you for all the help!
for: if(f), there is no condition, so is it supposed to be if ( f != NULL)?
I still don't think I am using it correctly, I tried doing:
front = response[0];
addString(front, response);
But that wasn't correct either.
I added:
struct node *addString(struct node *f, const char *response)
int main(void)
int menu(void)
I was able to fix my prior questions, but I am trying to create 3 char arrays and place each character into a node with a null node to separate each word.
#include <stdio.h>
#include...
How do i return everything in the linked list rather than having to return each individual node?
struct node *insert(struct node *f, char response)
needed to be:
struct node *insert(struct node *f, char *response)
And it fixed that error, but I still have a logic error where it only...
I am trying a new approach since my last post, and I am not sure if the logic is right or why my syntax is incorrect.
#include <stdio.h>
#include <stdlib.h>
struct node {
char...
I am not sure what you mean about the buffer overrun. I added a print method but for some reason, now my program crashes when I want to print out the linked list. I also think my previous code was...
After adding f = front, I get the first node to print correctly but all/most after do not correctly print.
I fixed my previous code, but now when I try and add a separate method it no longer works again.
#include <stdio.h>
#include <stdlib.h>
struct node {
char data;
I am trying to add characters to each node of a linked list.
#include <stdio.h> // NULL defined here
#include <stdlib.h> // malloc
struct node
{
...
I added:
while((getc(fp1)) != EOF)
{
textArrayPointer--;
}
after:
I am encrypting text from a file and storing the newly encrypted message in a text file.
If the ith char is an uppercase letter, shift it to be the char x[i] away where x = {3, -1, 0, 2, -2}
If...