1 / 5

DASL 130 – C Programming Course

DASL 130 – C Programming Course. Lecture 5. Structures. struct name{ type name; type2 name2; } instance_name = {name_val, name2_val};. Struct Example. struct point{ int x; int y; } ; void move_it(struct point *source, struct point* dest){ source->x = dest->x;

serge
Télécharger la présentation

DASL 130 – C Programming Course

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DASL 130 – C Programming Course Lecture 5

  2. Structures struct name{ type name; type2 name2; } instance_name = {name_val, name2_val};

  3. Struct Example struct point{ int x; int y; } ; void move_it(struct point *source, struct point* dest){ source->x = dest->x; source->y = dest->y; }

  4. Struct Example int main() { struct point location = {2, 3}; struct point move_to = {-1, -1}; move_it(location, move_to); }

  5. typedef typedef oldtypename newtypename; typedef struct newtypename{ struct contents; } newtypename; newtypename varname = value;

More Related