Difference between Array & Structure

S

Seebs

my name is enam. i hv a qs:
Difference between Array & Structure

One alphebetizes under A, the other under S.

Seriously, this question is too broad to have any meaning. How about you
start by reading about them in your textbook, and ask specific questions
if there's something you don't understand?

-s
 
E

enam

hi

my name is enam. i hv a qs:
Difference between Array & Structure

any reply will be appreciated

rgd
enam
091409
 
K

Keith Thompson

Seebs said:
One alphebetizes under A, the other under S.

Seriously, this question is too broad to have any meaning. How about you
start by reading about them in your textbook, and ask specific questions
if there's something you don't understand?

And please, spell out your words. "I have a question" is much easier
to read than "i hv a qs".
 
M

Michael Angelo Ravera

hi

my name is enam. i hv a qs:
Difference between Array & Structure

any reply will be appreciated

C's concept of a "struct"ure is, what in Computing Science parlance is
referred to as an "ordered, heterogenous array". C's concept of an
array is what is what in Computing Science palance is referred to as a
"homogeneous array".

Yes, you could support unordered heterogenous arrays in C by casting
pointers in an array, etc.

The main advantage of a C struct is that you can define the pieces to
whatever level of detail you happen to care to (subject to some
usually reasonable limitations). The main disadvantage is that you
MUST do so.

C arrays also permit nesting, but you are stuck with the limitation
that all of the elements will be of the same time. You can, however,
have arrays of structs of arrays of structs also.
 
D

Dr Malcolm McLean

my name is enam. i hv a qs:
Difference between Array & Structure
/* arrays */
int x[20];
double x[20];
double x[20][20];

/* structures */
struct point
{
double x;
double y;
double z;
};

struct employee
{
char firstnames[32];
char surname[32];
int payrollno;
double salary;
};

/* array of structures */

struct point triangle[3];


That's basically what you need to know.
 
N

ng2010

enam said:
hi

my name is enam. i hv a qs:
Difference between Array & Structure

any reply will be appreciated

Arrays are homogeneous and structs are heterogeneous.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top