If I have my command line such as:
foo arg1 arg2 << HEREDOC
line1
line2
HEREDOC
In foo, how can i get value from heredoc?
int main( char *argv[] )
{
string arg1=argv[1];
string arg2=argv[2];
string heredoc= ?
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The heredoc just redirects stuff into
stdin. So you can use: