New programmer: how to print a string
I used fgets to store strings into the data of my nodes.
My problem is that fgets also stores the new line character into my node's data.
I want to print the string to get this:
The line: "My first node's line" has been deleted.
I tried:
Code:
printf("\nThe line: "%s" has been deleted.", nodeToDelete->data);
The compiler cant work with the doubling up of ""
Even though I need to print the "", I tried:
Code:
printf("\nThe line: %s has been deleted.", nodeToDelete->data);
And it prints:
Code:
The line: My first node's line
has been deleted
Which is not what I want at all!