I stored a string in a node using fgets.
Its fine that the string has the new line character in it.
I just want to print the string without the newline character.
I dont want to change the data...
Type: Posts; User: 9988776655
I stored a string in a node using fgets.
Its fine that the string has the new line character in it.
I just want to print the string without the newline character.
I dont want to change the data...
I deleted my post because I came to realise it was a stupid question
When I call editorLineInsert and I reach fgets, my list pointer changes and points to somewhere completely random. I just dont get it.
After fgets magically changes the list pointer, I get a...
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...
I found out why my second program wont work.
scanf("%as", &a);
It stops reading when there is a space!
Will gets work with my large input?
I made the changes to the previous post. Am I creating any memory leaks now?
Previously, Elysia said:
The program itself seems to work alright. Can anyone suggest improvements?
This is my latest try: I dont know if its right though
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv) {
int i; int c; int N; char* temp;
...
I am still unsure of why there is a segmentation fault in my first program. How do I use malloc when I cant count how many characters are meant to be in my string? I looked at the information in your...
Hi i need to read an expression that is very large and stuff it in a string. I dont know how long the expression is but it can be over 1 million characters.
I need to use an array based solution....