careercup / CtCI-6th-Edition-cpp

Cracking the Coding Interview 6th Ed. C++ Solutions
1.36k stars 504 forks source link

sort function doesn't look right in Check_Permutation.cpp #2

Open needforspeed opened 8 years ago

needforspeed commented 8 years ago

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 commented 8 years ago

@KrishMunot What's the reason to close this?

KrishMunot commented 8 years ago

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.

needforspeed commented 8 years ago

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!

KrishMunot commented 8 years ago

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.