My bit of coding fluff is looking more like wet matted hair

7ef

So I added this little bit at the end here because why not, it added a bit of “je ne sais quoi.” However visually it is not sitting right with me…

Suggestions?

// I could set up [string complement = “your code is a work of art.”] and then reference that within the the string complement(). But that still feels like its extra steps…

Not quite sure what you’re after?

I’m not sure either. I think what is most disconcerting is the whole line of text after the return, it seems repetitive to have “your code is a work of art.” twice within the function.

Isn’t cout’s purpose to display said text unto the screen? Or should it just be return?

What I meant is that you have provided zero context so I don’t know what your intension is or what you’re amining to achieve, or anything really.

1 Like

I think what I am inquiring into is the “return” and various ways to end it. Let me get back to you on this once I try to recreate my initial error and see if I can elaborate on my concern.

Thanks

A cleaner way is to convert your compliment method from returning a string to return void (nothing). This would still run the cout in the method and print out the compliment but you wouldn’t need to have the return statment in there.

thumbsUp

Thank you! I will try that as soon as I finish up with the do / while section.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms