user2823765
user2823765

Reputation: 21

Main arguments in flex-bison

Sorry for my English. I need to take the value of the parameters of the main function. I said in Bison:

int main (int argc, char ** argv)

I compile in Windows:

file.exe <input.txt

=>

argc = 1

and

argv = "file.exe"

Why? Thank you.

Upvotes: 0

Views: 229

Answers (1)

David Angyal
David Angyal

Reputation: 241

Try "file.exe input.txt", without the "<": argv[1] will be "input.txt".

Upvotes: 1

Related Questions