yes payal , you can pass arguments from cmd line,
ex
int main(int argc, char *argv[])
{
if (args.count() != 2)
{
std::cerr << "argument required" << endl;
return 1;
}
myClass m; //ur class
m.test(args[1]); //pass cmd argument as function argument.
return app.exec();
}
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
QStringList args = app.arguments();
if (args.count() != 2)
{
std::cerr << "argument required" << endl;
return 1;
}
myClass m; //ur class
m.test(args[1]); //pass cmd argument as function argument.
return app.exec();
}
To copy to clipboard, switch view to plain text mode
hope it helpz
Bala
Bookmarks