So a period, a hyphen and a greater than symbol walk in a bar…

The bartender looks up and says: “Is this some kind of a joke?”  Nope, just my blog.

image 

The period, that’s right, the thing at the end of a sentence. Then, separately, the hyphen and greater than symbol working together.

See that the explanation at:

https://msdn.microsoft.com/en-us/library/b930c881(v=vs.80).aspx

How to use this information?  Here is some code, just plain old C++, running in VS 11 on Windows 8.  Not a big deal, not complicated, just what you would use in class. 

 #include <iostream>
  
 using namespace std;
  
 struct StructureExample{
    StructureExample(int i, int j, int k) : firstvariable(i), secondvariable(j), thirdvariable(k){}
    int secondvariable;
    int firstvariable;
    int thirdvariable;
 };
  
 int main() {
    StructureExample theStructureExample(1,1,1900);
    theStructureExample.secondvariable = 2;   
    //Use of the period for dereferencing, similar to C# or VB
    cout  << theStructureExample.secondvariable 
          << " *** " << theStructureExample.firstvariable
          << " *** " << theStructureExample.thirdvariable 
          << endl;
  
    //There are more efficient ways to do this, used for simplicity
    StructureExample *theStructureExample2 = new StructureExample(1,1,2000);
    //Use of the hyphen followed by greater than symbol
    //for dereferencing, similar to C# or VB
    theStructureExample2->secondvariable = 2;
    cout  << theStructureExample2->secondvariable 
          << "/" << theStructureExample2->firstvariable
          << "/" << theStructureExample2->thirdvariable 
          << endl;
  
    delete theStructureExample2;
  
    //holds the console window open, there are other ways
    system("Pause");
 }