Arrays and classess

Started by
2 comments, last by Andrew Nguyen 22 years, 2 months ago
I have a question. Can an array slot be a class instance? So if I did: class foo { int a } foo array1 [2] ?? Or, can I do this with a struct instead?
---START GEEK CODE BLOCK---GCS/M/S dpu s:+ a---- C++ UL(+) P(++) L+(+) E--- W++ N+ o K w(--) !O !M !V PS- PE+Y+ PGP+ t 5 X-- R tv+ b+ DI+ D G e* h! r-- !x ---END GEEK CODE BLOCK---
Advertisement
quote:Original post by Andrew Nguyen
I have a question. Can an array slot be a class instance?

Yes.
quote:Or, can I do this with a struct instead?

Yes.
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
Thanks.
---START GEEK CODE BLOCK---GCS/M/S dpu s:+ a---- C++ UL(+) P(++) L+(+) E--- W++ N+ o K w(--) !O !M !V PS- PE+Y+ PGP+ t 5 X-- R tv+ b+ DI+ D G e* h! r-- !x ---END GEEK CODE BLOCK---
Couldn''t you have spent something like 2 minutes to find that out?
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.

This topic is closed to new replies.

Advertisement