Use -> for structure pointer : structure pointer « Structure « C++ Tutorial






#include <iostream>
using namespace std;

struct account
{
   int accountnum;
   float balance;
   float interestrate;
};

int main()
{ 
 account myaccount;
 account *ptraccount;

 ptraccount->balance = 1000;
       return 0;
}








8.4.structure pointer
8.4.1.Define pointer for structure
8.4.2.Pointers to structures
8.4.3.Use -> for structure pointer
8.4.4.Compare address