system with variable

Hello!
Need to take variable char or string data and make system call as per above.
Please advise

const char key = "echo -n '3. Current Directory is '; pwd";
system(key);
Don't double-post. Use your thread in the Beginners' Section.
Topic archived. No new replies allowed.