Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. //.h
  2.  
  3. typedef struct      s_coord
  4. {
  5.     int             x;
  6.     int             y;
  7.     char            c;
  8.     struct s_coord  *next;
  9. }                   t_coord;
  10.  
  11. //.c
  12.  
  13. void        push_coord(t_coord **coords, int x, int y, char c)
  14. {
  15.     t_coord *ret;
  16.  
  17.     if (coords && *coords)
  18.     {
  19.         ret = *coords;
  20.         while (ret->next)
  21.                 ret = ret->next;
  22.         ret->next = create_coord(x, y, c);
  23.     }
  24.     else
  25.         *coords = create_coord(x, y, c);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement