I'm trying to make a program that loops through all of the characters in a string and replace each one with a...

I'm trying to make a program that loops through all of the characters in a string and replace each one with a corresponding alteration of the character. How should I start going about this without creating a rule for each separate letter?

ie. cin cout >> "_B__I__G_ _D__O__G__S_"

/dpt/
/sqt/

iterate though your list of chars, uppercasing and adding a _ before/after it.

is this a shitpost?

def munge s
'_' + s.upcase.chars.join('__') + '_'
end

'___'

how would I append that through the iteration? are there any chapter in a C++ textbook I should look at for the relevant expressions?

Are you mentally retarded or just a fucking idiot?

google search yielded nothing

getting expression must have class type on s

what does this even mean?

well.. if you don't have a dynamic array/list, you'll have to create another one (since you'll be altering it's size) and for each char read, you put: an underscore, the uppercased char, another underscore, and then just jump 3 units instead of one in the for loop, i guess.
if your array is dynamic there are perhaps better ways of doing it. there are always better ways of doing anything on cs.

cin >> words;
int size = words.size();
for (words; i = 0; i < size) ++i; {
while (i < size); {
":regional_indicator_" + words + ':';
}

}

cout

Should I encapsulate something in a function? I'm very lost here and obviously have had no formal education in this. Could anyone point me to any resources that explain this better?

>for (words; i = 0; i < size) ++i;
shouldn't it be
for (words; i = 0; i < size; ++i)
?

>how do I loop through a string

for fucks sake this is extremely low quality bait or you are retarded

It should be, but it tells me it is expecing ) after size;

oh my bad, it should be like this:
for (int i = 0; i < size; ++i) {
i totally ignored the first section of the for loop

sorry I wasn't born knowing C++ fluently. I'll try to get born better next time.

also, if you really want/need to learn, try getting Lipmann's C++ Primer or just get any book at http:// programming-motherfucker . com /
(it's a real site, i'm not joking lol)

Oh, yeah that worked. Thanks.

Try to get aborted next time, you dumb fucking shit stain.

I'll pirate whatever I can from the motherfuckers site tonight and start reading tomorrow. I was hoping I could finish this tonight, but there's no way.

if you worked up over something so trivial, your life must suck dude. i kinda feel sorry for you.

their books are all free :^) if you want to pirate something, go for lipmann's book, although i think you should learn C before C++ but who am i to say anything right?

Create a map where the keys are letters and the values are arrays of "alteration" characters.

As you iterate over the string, index the map with each character, generate a random number between 0 and array.size() -1, and retrieve the character at that index in the array. Then set string character to be equal to the character you just retrieved.

Really? Is C sharp lower level than C++?

No, but C is. besides Assembly, C will be the lowest level language one would use.

Anyway, I gotta go.
if you want to learn C (what I think you should do before C++) try searching for K&R C Book, it's the start of C, everyone should at least once at it imo.
also, pic of my book :^) see ya

Thanks a lot guy, I'll check it out!

Is there meant to be a space between the words? On mobile so can't tell.

The C way:
Make new storage location
Create counter at 0
For every character in input copy over _, char, _... Incrementing counter each time

//Java way
String input = "bdog";
String output = "";
For(int i = 0; i < input.length(); i++) {
Output += ('_' + input.charAt(i) + '_');

I'm on the toilet so this might not be syntactically correct