-
October 26th, 2004, 09:08 PM
#1
Member
C++ Data Type
Ok, I remember from last year that you can create a data type of whatever you want and use that in a struct. I have looked through my C++ book, and I am kinda lost. I am not really sure how to ask you want I want to know...so I will just give an example, I guess.
Say I am creating a program for a company, and they want me to create an array of all of the employees. And under each employee they want some information, like name, gender, age, pay and so on. What I am trying to do is create some kinda datatype that will have a char, int, float and whatever else I want in it. I remember doing this, And I thought it was something like:
datatype thisdata;
struct thisdata{
int age;
char gender;
}
That just looks wrong. I am pretty sure I know how to use struct correctly, but how do I make an array struct. Is this just so easy I am confusing myself, or should I just try this with classes? Help :-?
-Ep
01001001001000000100110001101111011101100110010100100000010000100110010101110100011101000111100100100001
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|