Specifically, the code sample here works great, but only when the string is stored in a file.
Sometimes I need it to process a generated string (stored in a string variable), but I'm having trouble convincing fgets's third parameter to work with string variables because it's a pointer to a FILE structure.
Or perhaps there's a functional equivalent to fgets that may be used on strings?
Any suggestions? Thanks!