How to i change 1E to 1X in C++

Hi my question is that i have a row of numbers 1E to 12E
But i want to change it to X as i wish

E.G 1E 2E 3E 4E 5E 6X 7E ...12E
1E 2X 3E 4E 5E 6X 7E ...12E

how do i do it?
'X' isn't a valid hexadecimal value, so you can't.
You will have to provide more parameters than just "as you wish".

Otherwise you have something like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <fstream>
#include <iostream>

int main( void )
{
  std::ifstream input( "input.txt" );
  std::ofstream output( "output.txt" );
  
  char ch;
  while ( input.get( ch ) )
  {
    if ( ch == 'E' )
    {
      char choice;
      std::cout << "I found an E, do you want it to be an X? ";
      std::cin >> choice; std::cin.ignore( 80, '\n' );
      if ( choice == 'y' )
      {
        std::cout << "As you wish\n";
        ch = 'X';
      }
    }
    
    output << ch;
  }
  
  return 0;
}
You haven't told us nearly enough about what you're trying to do. The subset of programmers and telepaths is really, really small, so you're much better off not relying on us to be able to read your mind.

Firstly, the things you've posted aren't numbers. How are you storing them? As STL strings? C-style strings? Some other representation?

@ MikeyBoy: Except for 'X' those are hexadecimal numbers. Hence my post above.
Some of those items would be valid as hex numbers, and others wouldn't be. That leads me to conclude they are not intended to be hex numbers.
Poor Nicholas has posted more than one thread about his blight, scattering tiny bits of info around. It takes more boredom than psychic powers to make a guess and consequently conclude that exact same homework has been assigned to other recent Forum user too.
Topic archived. No new replies allowed.