C function to execute a program and return the output of the program
Hello. I am making a program in C to display the song xmms is playing using xosd. The only problem I have is how to retrieve the current song. I figured the best way would be to execute
Code:
xmmsctrl title Thank you for your time. |
'man popen'.
|
Code:
FILE *f=popen("xmmsctrl title","r"); |
And it should. You're referencing an unitialized pointer, the behavior of which is undefined. You're lucky your program didn't send an e-mail bomb to your employer about the use of company facilities.
Try this instead: Code:
FILE *f = popen("xmmsctrl title", "r"); |
thanks
|
All times are GMT -5. The time now is 08:02 AM. |