Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ - command line argument compare #9

Open
tophe38 opened this issue May 27, 2021 · 0 comments
Open

C++ - command line argument compare #9

tophe38 opened this issue May 27, 2021 · 0 comments

Comments

@tophe38
Copy link

tophe38 commented May 27, 2021

Hi,

in main.cpp, line 149 and 153, it would be better to use strcmp() instead of strstr() to identify command line argument.


	// Parse the command line arguments.
	for (int i = 1; i < argc; ++i)
	{
		if ((strcmp(argv[i], "outfile") == 0) && (i + 1 < argc))
		{
			outStream.open(argv[i + 1]);
		}
		if (strcmp(argv[i], "dump") == 0)
		{
			dump = true;
		}
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant