Uninitialized.. I will remember that. Thanks.
Type: Posts; User: dipesh.nomad
Uninitialized.. I will remember that. Thanks.
I have a very small doubt(might sound silly..).
consider a char pointer that is undefined.
char *p;
now, if i try to access the undefined pointer, i will get a run time error.
i've changed it to char *temp = malloc(string_length(str) + 1) for string_copy. Thanks for the help.
4 + 7 = 11.
in my code, it creates 11 bytes. and there is no space for the final '\0' character.
i sill don't get it.
char *str1 = "";
char *str2 = "";
char *str3 = string_join(str1, str2);
char *str4 = "";
char *str5 = string_copy(str4);
char *str6 = "Hello";
char *str7 =...
to copy an empty string, 1 byte i think for '\0' or the number of bytes reserved for the empty string.
i'm not sure what the other issue is. is it casting the new memory of the malloc function?
i changed the line to temp = malloc(string_len(str1) + string_length(str2));
i also changed the similar line in string_copy function which solved my problem.
Thanks a lot.
i'm tried using gdb. its not helping me fix my problem.
can anyone help me? here is my problem.
everytime i try to print the head node data and current node data, only first 25 characters from the string are printed.
here is the source code..
...