I am having trouble in accomplishing certain task in C++ which I am able to do in Pascal / Delphi quite easily.
1st
In Pascal : Type DataBase record = Name:String(25); Cell:String(12); City:String(20); end;
Customer : DataBase;
In C++: class DataBase = {public: char Name[25], Cell[12], City[20];};
DataBase Customer;
OKAY we are good here.
In Pascal : Customer.Name = "Poigahn";
In C++: Customer.Name = "Poigahn"; < Will Not Compile
So I am writing a segment of code that changes the information inside Variable Customer based on Conditions, So I do not want to assign values at time of instance. Also do not want to use the cin function because values are predetermined by programmer. So How do I do this ?
2cnd
In Pascal : With Customer do
Name = "Poigahn";
Cell = " 1234567890";
City = " Somewhere"; end;
or
readln(Name); I can make assignments this way ( useful when there is allot of info to change withinh the class variable )
Rather Than Having to do assignments by doing > Customer.Name = " " or Readln(Customer.Name)
In C++ : I can not find any such function. ( I might be looking right over it since I do not know what the function would be )
Now I have to do cin >> Customer.Name;
or
getline(cin,Customer.Name);
Does anyone know how to do in C++ what I am able to do in Pascal ??