• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

Address UNICODE 64-bit VS2015

Started by Patrice Terrier, January 18, 2017, 12:35:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Frederick J. Harris

In the above CVector Class code I initially set the size of the underlying array to 10.  But when it hits that it doubles the buffer to accomodate pushes 10 through 19.  Then it bumps it up again to accomodate pushes 20 to 25.  So its infinitely (within reason) growable as a container with constant time pushes.

James C. Fuller

Fred,
  While that is indeed interesting I still am not able to figure out how to access from my demo above.

James

Frederick J. Harris

Let me look at that.  It involves the crazy angle brackets at the end of the expression.  I have a doctors appt in a bit and might not get back until later.

Frederick J. Harris

Had to use the getptr() member to get it to work...


AeDynArray<AddressType>* pAddArray = new AeDynArray<AddressType>;   // 399,872
...
...
pAddArray->Add(Address);
...
...
AddressType* pAdd=(AddressType*)pAddArray->getptr();
_tprintf(_T("%s\n"),pAdd[4].Company);

James C. Fuller

Fred,
  Not quite.
I did some more surfing and found the answer I think. It works anyway whether it's politically correct or not :)
James


_tprintf(_T("%ls\n"),(*AddArrayPtr)[2].CityName);