I have run into another mind bogglement.
Now the pointer is confusing me again...
What do each of these mean in simple terms?
Code:
// pointers to structures
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
struct movies_t {
string title;
int year;
};
int main ()
{
string mystr;
movies_t amovie;
movies_t * pmovie;
pmovie = &amovie;
cout << "Enter title: ";
getline (cin, pmovie->title);
cout << "Enter year: ";
getline (cin, mystr);
(stringstream) mystr >> pmovie->year;
cout << "\nYou have entered:\n";
cout << pmovie->title;
cout << " (" << pmovie->year << ")\n";
return 0;
}
Code:
pmovie->title
Code:
(*pmovie).title
Code:
*pmovie.title
Code:
*(pmovie.title)
What do each of these mean in simple terms?