Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Difference between Array & Structure

Reply
Thread Tools

Difference between Array & Structure

 
 
Seebs
Guest
Posts: n/a
 
      03-30-2010
On 2010-03-30, enam <(E-Mail Removed)> wrote:
> 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
--
Copyright 2010, all wrongs reversed. Peter Seebach / http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
 
Reply With Quote
 
 
 
 
enam
Guest
Posts: n/a
 
      03-30-2010
hi

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

any reply will be appreciated

rgd
enam
091409
 
Reply With Quote
 
 
 
 
Keith Thompson
Guest
Posts: n/a
 
      03-30-2010
Seebs <(E-Mail Removed)> writes:
> On 2010-03-30, enam <(E-Mail Removed)> wrote:
>> 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?


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

--
Keith Thompson (The_Other_Keith) (E-Mail Removed) <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Michael Angelo Ravera
Guest
Posts: n/a
 
      03-30-2010
On Mar 29, 11:32*pm, enam <(E-Mail Removed)> wrote:
> 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.



 
Reply With Quote
 
Dr Malcolm McLean
Guest
Posts: n/a
 
      03-30-2010
On 30 Mar, 07:32, enam <(E-Mail Removed)> wrote:
>
> 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.
 
Reply With Quote
 
ng2010
Guest
Posts: n/a
 
      04-03-2010
enam wrote:
> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between c structure and c++ structure raghunandan_1081@yahoo.com C++ 9 11-11-2011 07:34 AM
FAQ 4.40 What is the difference between $array[1] and @array[1]? PerlFAQ Server Perl Misc 0 04-16-2011 04:00 AM
difference between a pointer array and a stack array? Ahmad Humayun C Programming 10 05-28-2008 06:04 PM
Difference between bin and obj directories and difference between project references and dll references jakk ASP .Net 4 03-22-2005 09:23 PM
Newbie: Difference between $array[0] and @array[0] darren_uk Perl Misc 4 11-01-2003 06:04 AM



Advertisments