Forum

Array V/S Structure

This thread contains 1 reply, has 2 voices, and was last updated by  Nitesh User Do not delete 4 months, 3 weeks ago.

  • Author Replies
  • #55189

    What is The Difference Between Array and Structure in C Language?


  • #55191

    ARRAY

    1) Array refers to a collection comprising of elements of a homogenous data type.
    2) The array uses subscripts or “[ ]” (square bracket) for element access
    3) The array is a pointer as it focuses on the primary element of the collection.
    4) Array size is fixed and is basically the number of elements multiplied by the size of an element.
    5) Bit filed is not possible in an Array.
    6) Array declaration is done simply using [] and not any keyword.
    7) An array is a primitive datatype
    8) Array traversal and searching are easy and fast.
    9) Array elements are stored in continuous memory locations.
    10) Array elements are accessed by their index number using subscripts.

    STRUCTURE

    1) Structure refers to a collection consisting of elements of a heterogeneous data type.
    2) The structure uses “.” (Dot operator) for element access
    3) The structure is not a pointer
    4) Structure size is not fixed as each element of Structure can be of different type and size.
    5) Bit filed is possible in a Structure.
    6) Structure declaration is done with the help of the “struct” keyword.
    7) A structure is a user-defined datatype.
    8) Structure traversal and searching are complex and slow.
    9) Structure elements may or may not be stored in a continuous memory location.
    10) Structure elements are accessed by their names using a dot operator.


    Regards,
    Nitesh Bavishiya

You must be to reply to this thread.Please or . Registration is 100% free.

GET FREE CONSULTATION

Call Us Now For Free Consultation97370 05566

Our experts listen to you patiently and suggest you the right course after conducting a personality profile test. Register your interest below to schedule personality profile test for you.

SUBSCRIBE TO OUR NEWSLETTER

Contact Us

Working Hours

  • Monday9:00 AM – 9:00 PM
  • Tuesday9:00 AM – 9:00 PM
  • Wednesday9:00 AM – 9:00 PM
  • Thursday9:00 AM – 9:00 PM
  • Friday9:00 AM – 9:00 PM
  • Saturday9:00 AM – 9:00 PM
  • SundayClosed
Copyright 2016-2019 Smart Mentors. All Rights Reserved.

Login

FORGOT PASSWORD

Sign up now to Become An Instructor

Register your Interest