Initial input

Hi there, I was wondering which function is used to get any initial input string when the program is run, i.e: if I typed ¨./testprogram bla bla bla¨ into the terminal, how can I get the "bla bla bla"

Thanks
1
2
3
4
5
6
7
#include <iostream>
int main(int argc, char *argv[])
{
    for(int i=1;i<argc;i++) // note that argv[0] ise the command used to invoke the program
        std::cout<< argv[i]<< " ";

}


See http://www.cplusplus.com/forum/articles/13355/
thanks!
Topic archived. No new replies allowed.