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

Please use const char * (instead of char *) if possible #1

Open
euyuil opened this issue Aug 4, 2018 · 2 comments
Open

Please use const char * (instead of char *) if possible #1

euyuil opened this issue Aug 4, 2018 · 2 comments

Comments

@euyuil
Copy link

euyuil commented Aug 4, 2018

For example, the function Login can take const char * as parameters. The library does not output the user name and password. It is not necessary to pass char * as parameters. Using const char * will also allow us to use string literals without compilation warnings.

https://github.com/abramwang/QuantPlusApi_Cpp/blob/7117dea1358b76d1ebab67476ab4acdae1aadd0e/include/PT_QuantApi.h#L352

@euyuil
Copy link
Author

euyuil commented Aug 4, 2018

Also, the following example can be also improved, see last 2 parameters of:

https://github.com/abramwang/QuantPlusApi_Cpp/blob/7117dea1358b76d1ebab67476ab4acdae1aadd0e/include/PT_QuantApi.h#L452

MD_ISODateTimeType is of type char[21]. I suggest to define a new type, for example, typedef const char MD_ConstISODateTimeType[21] and use this as the type of the two parameters.

@muaji
Copy link
Collaborator

muaji commented Aug 6, 2018

Fine, Thx for your suggestion.We will improve this in the next version.

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

2 participants