Lexicographically

Sir/ma’am

is there any way to acess elements like this s[0]=abc s[1]=acb s[2]=bac s[3]=bca s[4]=cba s[5]=cab
currently when i try to access elements by s[0] output gives “a” only.i am trying to sort these permuation lexicographicaly.

If s is a character array then s[0] can never be equal to “abc”. Because it can only hold a character.
For this purpose, you can make a vector or an array of strings.
Refer this https://ide.codingblocks.com/s/270455

Thank you sir !!!