0
Structures in Cs
Typing Speed:19

Fasalul habeeb
fasalulhabeeb@gmail.com
www.facebook.com/Fasalul
habeeb
twitter.com/usern...
Structures In C
• A structure is a collection of one or more
variables, possibly of different data types,
grouped together...
Structure declaration
• A structure type is usually defined near to the start of a file
using a typedef statement.

•
•
•
...
Nested structures
• Structures can contain other structures as
members; in other words, structures can nest.
Consider the ...
Arrays of structures
• Just as arrays of basic types such as integers
and floats are allowed in C, so are arrays of
struct...
Pointers to structures
• A pointer to a structure types
variable is declared by a
statement such as the following:
• struc...
Example of structuer
•
#include<stdio.h>
struct person
{ char *name;
int age;
• };
int main()
{ struct person p;
p.name = ...
THE END
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.

Thanks in advance.
www.baabtra.c...
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550

Start up Vil...
Structure in c
Upcoming SlideShare
Loading in...5
×

Structure in c

444

Published on

Structure in c

Published in: Education, Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
444
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
36
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Structure in c"

  1. 1. Structures in Cs Typing Speed:19 Fasalul habeeb fasalulhabeeb@gmail.com www.facebook.com/Fasalul habeeb twitter.com/username in.linkedin.com/in/profilenam e 9544962714
  2. 2. Structures In C • A structure is a collection of one or more variables, possibly of different data types, grouped together under a single name for convenient handling. • • • • • Structure declaration Nested structures Arrays of structures Pointers to structures Structures and functions
  3. 3. Structure declaration • A structure type is usually defined near to the start of a file using a typedef statement. • • • • • • • typedef struct { char name[64]; char course[128]; int age; int year; } student;
  4. 4. Nested structures • Structures can contain other structures as members; in other words, structures can nest. Consider the following two structure types: • • • • • • • struct first_structure_type { int integer_member; float float_member; }; struct second_structure_type { double double_member; struct first_structure_type struct_member; };
  5. 5. Arrays of structures • Just as arrays of basic types such as integers and floats are allowed in C, so are arrays of structures. An array of structures is declared in the usual way: • struct personal_data my_struct_array[100];
  6. 6. Pointers to structures • A pointer to a structure types variable is declared by a statement such as the following: • struct personal_data *my_struct_ptr;
  7. 7. Example of structuer • #include<stdio.h> struct person { char *name; int age; • }; int main() { struct person p; p.name = "John Smith"; p.age = 25; printf("%s",p.name); printf("%d",p.age); return 0; • }
  8. 8. THE END
  9. 9. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  10. 10. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×