CtCI-6th-Edition-cpp icon indicating copy to clipboard operation
CtCI-6th-Edition-cpp copied to clipboard

sort function doesn't look right in Check_Permutation.cpp

Open needforspeed opened this issue 8 years ago • 4 comments

Is it just pseudo code?

Should the void main be removed in the function below?

void main std::wstring sort(const std::wstring &s)

https://github.com/careercup/CtCI-6th-Edition-cpp/blob/c183b22fae922211a9fe460cb883b31433805b58/Ch%201.Arrays%20And%20Strings/2.Check%20Permutation/1.Check_Permutation.cpp#L5

wstring doesn't have a member named toCharArray on line 7.

If not, how do you compile the file?

Thanks,

needforspeed avatar Apr 06 '16 19:04 needforspeed

@KrishMunot What's the reason to close this?

needforspeed avatar Apr 19 '16 13:04 needforspeed

It looked good to me when I last compiled the program. However, your issue seems to be valid.

Sorry for looking over the issue. You may send a new PR with suggestions to improve the code.

KrishMunot avatar Apr 19 '16 14:04 KrishMunot

Could you provide the compile instruction for the project or the file? What compiler did you use and what was the version of compiler?

Thank you!

needforspeed avatar Apr 19 '16 14:04 needforspeed

I don't remember the specs of the compiler that I used to compile the program (It was a long time ago and have been switching machines lately) I would recommend you to compile it in any gcc compiler of the latest version available.

KrishMunot avatar Apr 19 '16 14:04 KrishMunot