简体   繁体   中英

Unique character code not working when ran in linux but fine in windows (C++)

When I run the code in windows, it works as expected. But when I run it in linux, the program doesn't run as expected and produces a completely different output.

I'm assuming its a problem in the all_unique_letters method, but I can't seem to figure it out.

In bool all_unique_letters(const string &s) , unsigned int v; is used without being initialized. If it contains something else that 0 , the function reports a letter as a duplicate when it is not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM