Reputation: 1
/* I thought of doing in this way, but it invalid. so any help will be appreciated. */
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main()
{
string name = "Karma";
string greet = "How was your day?";
string sums = name + greet;
system("say %s", sums) // not working
// system("say sums") not working
return 0;
}
Upvotes: 0
Views: 68
Reputation:
You can use:
system(("say" + sums).c_str())
Instead of:
system("say %s", sums)
Upvotes: 2