String literals are stored in read only section of memory. Any attempt to modify the contents of a string literal invokes Undefined Behaviour (segmentation fault on most implementations).
Use an array of characters rather
char str[] = "HelloGuys";
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…