'r' represents a single character.
"r" represents a c-string (which is a series of zero or more characters terminated with a null character, '\0').
More reading: C Strings - Cprogramming.com
Type: Posts; User: Matticus
'r' represents a single character.
"r" represents a c-string (which is a series of zero or more characters terminated with a null character, '\0').
More reading: C Strings - Cprogramming.com
(source: popen(3): pipe stream to/from process - Linux man page)
Note you're using a single character ('r') as the second argument. Make it a string by using double quotes instead ("r").