Message from C, C++ talks

June 2019

— Or string class or

or 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

Message permanent page


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?

— Https://

— Giv simple example

— Hello world

— #ot

— Https://

— Hii

— This is a C++ chat not a hacking chat

— I am sorry I just get angry at script kiddies. Stupid questions like “how do I hack wifi” or “can I use someone else credit card for Netflix, can they track me” I am sorry but that one killed me

Message permanent page