This is where you do it correctly:
You can then use fp in functions like fseek and fread to manipulate example.txt, which due to the 2nd parameter "r" has been opened in read only mode.
But I'm still not sure what you are intending. Your code also uses ifstream and ofstream on the same file and these on their own should be sufficient for the operations you want to perform. So my question is: what exactly do you think that fopen is adding to the mix? Do you think [i/o]fstream aren't opening the files properly and need extra help? (Doesn't work that way.) If you want to use fopen to open the file then you need to use fopen-related functions to access the file; you can't fopen a file then modify it with [i/o]fstream.
So here's my suggestion. Remove the FILE and fopen stuff altogether on the grounds that it's completely unnecessary.
What is your while loop
doing? a_file is already open at this stage. The flow here is: if the user types open, open the already open file, break the loop, then close the file. This I don't get at all. What are you trying to achieve here?
One step at a time. If you close the file and end the program after "a_file<<"alphabet: "<<y ;", does the file contain what you expect? Open the file with your favourite text editor to find out.