title: How to include a string variable(char *) within "system" command - linux
body: <p>char * <strong>S</strong> = "hello";  // assume it's dynamically allocated correctly </p>
  
  <p>I want to use S in the below statement when S would be treated as a string with the value "hello". </p>
  
  <p>system("grep <strong>S</strong> searchtext.txt > result.txt"); </p>
  
  <p>How do I do this?</p>