Hi. I am trying to ask user for input which is string type. Then I use pointer to point to that string address. Then I use pointer again to name the class by using the value that the pointer contains. Though software does not allow me to do that because it now allowed to convert variable types... I also have the program here:
using namespace std;
cout << "Please specify name: ";
cin >> internal_user_input;
UI_ptr=&internal_user_input; account *UI_ptr; //I GET THE ERROR HERE
//Thank you soooo much for the help bro!
In the line
you are declaring that UI_ptr is a pointer to a string.
Later in the code is says
which declares that UI_ptr is a pointer to an account.
You cannot have 2 declarations for UI_ptr in the same code block.
I suppose you are trying to create an account with a particular name.
You need to create a constructor in class account, and pass the internal_user_input to the constructor as a parameter. In the constructor you need to assign the parameter to the name in the class. The class needs string name, not char name. Char is just 1 character.