bash - Passing Arguments Through system() in C++ -


how pass command line variable though system() command in c++. have tried using:

string i; = system("./findname.sh"); += argv[1]; cout << i; 

but when run gives me condition wrong number of arguments have written in shell script.

this output received when running program "./findname brandonw". executable file ran argument want shell script run with.

the arguments put are: brandonw usage: findname.sh [only_one_argument] 

just concatenate command string.

string command = "./findname.sh"; command = command + " "  + argv[1]; system(command.c_str()); 

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

html - Outlook 2010 Anchor (url/address/link) -