Hey guys, sorry, another probably no brainer that's sending me through the wall.
I can't seem to access the data in a structure when I create a function.. which is really annoying me!
Code:
#include <iostream>
using namespace std;
struct persons
{
string name;
string Brief_comments;
int age;
int Client_number;
};
int first_section
{
persons structure;
cout << "Please enter the clients name to store: ";
cin >> structure.name;
cin.ignore();
};
persons structure gives me an error (Expected primary expression before ect ect ect) basically trying to tell me YOU CAN'T DO THIS!
Is there a rule in C++ (Or all languages for that matter) that prevents me accessing the structures information through a separate function?
Thanks in advance all!