Im refreshing my C++ and yay im rusty!
Im currently exploring structures.
is it possible to create a string in a structure using C++?
this wont compile due to that problem, any ideas.?
#include <iostream>
using namespace std;
struct ContactList {
int Uid;
string FirstName;
int PhoneNumber;
};
int main()
{
ContactList Person;
Person.Uid = 1;
Person.FirstName = "David";
Person.PhoneNumber = 123456;
cout << "Contact List" <<"\n";
cout << "____________________________" << "\n";
cout << "Uid:" << Person.Uid << "\n";
cout << "FirstName:" << Person.FirstName << "\n";
cout << "PhoneNumber:" << Person.PhoneNumber << "\n";
cout << "____________________________" << "\n";
cout << "end.. press enter";
cin.get();
}
If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself