Suppose we have a certain array:

char myChar[] = "Something"; 

I need to make for each element of the array the generation of a random symbol from the set:

 &@?!#%^* 

Google is bad, please do not throw slippers, if the solution is already in public.

  • Transferred from the question, further TS: EDIT: I will be grateful if you also teach how to properly form the subject, BB codes do not work, I don’t know anything. - 0xdb
  • Regarding the design, markdown syntax is used (most of the topics in the manual can be clicked for more detailed help). You can also watch the layout of the answers / questions of other participants by clicking "edit". - Fat-Zer

1 answer 1

Not very clear what you want. Replace letters with random characters? Something like that?

 char myChar[] = "Something"; for(char * c = myChar; *c; ++c) { *c = "&@?!#%^*"[rand()%8]; } 
  • Yes, you understood me right - hearMe_