— Will check
— Or string class oror may be try more basic .char array
— If i isn't equal to n-1, that condition will evaluate to false which would be the 0th index, so " ", but if i is equal to n-1, then that condition will evaluate to true, which is 1, so it'll access the element at index 1 which is "\n"
Message permanent page
— Why it is only valid for last index??
Because n-1 doesn't change and so the only time that'd be valid is when the loop is on the last iteration
— What if i want to print a random index char from string other than last index "abcd" c to be printed??
— What should condition be like?
— So you just want to print a random character from the string?
— Giv simple example
— Hello world
— This is a C++ chat not a hacking chat