May
22
awarded Curious
May
22
revised Segmentation fault when trying to allocate memory for a string via a pointer-to-pointer function call
corrected spelling
May
21
accepted Segmentation fault when trying to allocate memory for a string via a pointer-to-pointer function call
May
21
asked Segmentation fault when trying to allocate memory for a string via a pointer-to-pointer function call
Apr
11
awarded Self-Learner
Apr
10
accepted Getting incorrect values when accessing variables passed along in a pointer to a character array for strtok
Apr
10
comment Getting incorrect values when accessing variables passed along in a pointer to a character array for strtok
Nope, thank you! :)
Apr
10
comment Getting incorrect values when accessing variables passed along in a pointer to a character array for strtok
Would you be able to edit your answer with a corrected version of code?
Apr
10
comment Getting incorrect values when accessing variables passed along in a pointer to a character array for strtok
Would you be able to answer with a corrected version, I don't really come from a memory allocation background
Apr
10
comment Getting incorrect values when accessing variables passed along in a pointer to a character array for strtok
But I thought I was writing the output of strtok to ` arrToStoreTokens[x]`?
Apr
10
revised Getting incorrect values when accessing variables passed along in a pointer to a character array for strtok
added 58 characters in body
Apr
10
comment Getting incorrect values when accessing variables passed along in a pointer to a character array for strtok
Yeah, just checked, problem persists when not in root
Apr
10
asked Getting incorrect values when accessing variables passed along in a pointer to a character array for strtok
Apr
10
comment Trying to return char array via pointer and it's giving incorrect results
I've made the length a macro and defined it in a commonmacros.h file, the requested input will always be 65 chars long (64 + \0)
Apr
10
answered Trying to return char array via pointer and it's giving incorrect results
Apr
10
comment Trying to return char array via pointer and it's giving incorrect results
Why do we need to free(command)? Are you referring to here the command located inside the getUserInput scope or inside the main scope?
Apr
10
revised Trying to return char array via pointer and it's giving incorrect results
added 6 characters in body
Apr
10
comment Trying to return char array via pointer and it's giving incorrect results
I come from a C# background, is it possible to instead just return the value of command from the getUserInput function?
Apr
10
comment Trying to return char array via pointer and it's giving incorrect results
So instead of returning a pointer to "command", I should be returning the char array command itself?
Apr
10
asked Trying to return char array via pointer and it's giving incorrect results
1 2 3 4