Store text variable in a char array

Good I am doing a problem that they left me in the university which asks me to develop a program which must store in a variable the text: "Pablito nailed a clavito. What clavito nailed Pablito? "As arrangement char. I think that it is already, then I ask that using pointers go through the previous variable and generate a new string where any random letter is replaced, that pointers still do not master it well and what appears on the internet is more with arrays and pointers. Whole type, if you know of any page or video that can instruct me I would appreciate this is what I have code just because I have no idea how to do the rest.

In the version of your code you have no place in which to generate a new chain, for this we have created an array called palabra that will be the recipient of the modified chain, the length of this array must be the same as sizeof(palabra) , that's why char is used as size.

In the loop at the end of my proposal, we created three pointers to origen :

palabra : points to the beginning of the original string ( destino ).

copia : points to the beginning of the string that will contain the modified copy ( final ).

palabra : points to the end of the original string ( origen ).

When the pointer final is equal to the pointer origen != final we know we should stop copying, so the second part of the loop contains the instruction origen since we will copy as long as the final is not origen , otherwise we will advance both the destino and the ++origen, ++destino in the third instruction of the loop: destino .

For each loop turn we will copy EN the address pointed to by origen the original letter of *destino = ... or a letter generated at random (25% of the time); to achieve this we must de-reference the pointer to modify ( *origen ) or read ( %code% ) its content.