All pastes #397597 Raw Edit

Stuff

public text v1 · immutable
·published 2007-03-16 16:31 UTC
rendered paste body
Write the function QString shift(const QString& text);

shift() uses the member m_Key to set the random function's seed by calling srandom(). For each character ch in the given string, text, produce a shifted character by adding the next pseudo-random int to the code for ch. The shifted character is then put in the corresponding place in the new string. When all the characters of text have been processed, shift() returns the new string.