No error... Code just not working???

P.S. Sorry for the broad title just didn't know how to describe it :/

Hey guys, I'm new to this forum. I was just wondering, I have this code:
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
29
30
31
32
33
34
35
36
37
38
39
40
41
int code(){
    
    cout << "Insert the line to be coded: ";
    string codeline;
    cin >> codeline;
    cout << endl;

    std::string str (codeline);
    int codesize = str.size();
    
    int i = 1;
    std::string fullcode;
    char get;
    string codechange;
    
    while (codesize>=i){
          get = codeline[i];
          
          if(get='a'){
          codechange=="o";             
          }
          else if(get='b'){
          codechange=="p";
          }
          else if(get=' '){
          codechange==" ";
          }
          else{
          cout << "ERROR INCORRECT INPUT, PLEASE RUN PROGRAM AGAIN...";
          cout << endl;
          cout << endl;   
          } 
          
          fullcode.append(codechange);
          i++;
          }
    
    cout << endl;
    cout << "Finished CODE: ";      
    cout << fullcode;
}


And I was wondering what is wrong with my code. I am getting no errors so I can't tell. When I input "a" so that it should output "o", I get an empty output... What am I doing wrong?!
You are using the wrong operators from lines 19 to 26.
1
2
3
int var;
   var = 10; //Assign a value
if(var == 10) //Test if var is equal to 10 
Topic archived. No new replies allowed.