I'm supposed to create a function that takes a char& argument and modifies that argument. In main, print out a char variable, call the function for that variable, and print out again to prove that it has been changed.
I've tried a few times but I cant seem to do it correctly. Can someone please show me an example of how I'm supposed to do this.
//change_char.cpp
//##
#include <iostream>
using std::cout;
using std::endl;
//function prototype
void change_char(char& someChar);
int main(){
char character='A';
cout<<"Character: "<<character<<endl;
change_char(character);
cout<<"\nCharacter after calling\n \"change_char\" function : ";
cout<<character<<endl;
return 0; //indicates success
}// end of main
void change_char(char& someChar){
someChar='B';
}//end function change_char
Character: A
Character after calling
"change_char" function : B