DawidS28

Untitled

Mar 9th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. struct node {
  2.     string imie;
  3.     string nazwisko;
  4.     node* next;
  5. };
  6.  
  7. struct ksiazka {
  8.     node* poczatek;
  9.     int liczba_elementow = 0;
  10. };
  11.  
  12. int create(ksiazka **nowa) {
  13.     *nowa = malloc((sizeof) ksiazka);
  14.    
  15.     if(*nowa == NULL)
  16.         return 1; //blad
  17.     else
  18.         return 0; //bez bledu
  19. }
  20.  
  21.  
  22. // i potem wywolanie:
  23.  
  24. int main() {
  25.     ksiazka* mojaksizka;
  26.     if(!create(*mojaksiazka))
  27.         printf("BLAD!");
  28.     else
  29.         printf("BEZ BLEDU, UTWORZONO");
  30.    
  31.     return 0;
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment