[CC150] Ch1.2 Reverse C-style string

1.2 Write code to reverse a C-Style String. (C-String means that “abcd” is represented as five characters, including the null character.)

Classic question...
Algorithm is simple, but got stuck during initialization... usages of string.c_str() and "abcd"
return const char*, and then error happens during swap the elements in const array...

Comments

Popular posts from this blog

Maximum Gap

[ITint5] Maximum Subarray for a Circular Array

[CC150] Chapter 8 Object-Oriented Design