cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Classes
Classes
Mar 23, 2011 at 10:50am UTC
zone19871
(40)
class hi
{
int x
}here;
hi here[5]
here[1].x
This is the class i got. can i give values to each struct in the array, i mean like you got
here[1].x
to call it but can you say something like
here.x.x1
to call that value instead? is there anyway of doing this because this is better labeling
Mar 23, 2011 at 11:01am UTC
Athar
(4466)
...what?
Mar 23, 2011 at 11:45am UTC
WriteGreatCode
(73)
Athar
wrote:
...what?
I'm with you on this one.
Sorry, zone19871, but we can't really understand what you're asking.
Mar 23, 2011 at 1:53pm UTC
king214
(231)
Do you want to declare an array for your class, because then you just do it like any other array declaration.
int
x[5]
//Declares 5 types of int!
So in your case:
hi here [5]
//declares 5 types of "hi"
i mean like you got here[1].x to call it but can you say something like here.x.x1 to call that value instead
Dare I say: what?
Topic archived. No new replies allowed.