Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. pr->stock = stock;
  2. pr->price = price;
  3.  
  4. int codeSize = strlen(code);
  5.  
  6. if(codeSize > 7)
  7. codeSize = 7;
  8.  
  9. memcpy(pr->code, code, 7);
  10. code[codeSize] = '\0';
  11.  
  12. int titleSize = strlen(title);
  13. pr->title = malloc(titleSize * sizeof(char));
  14. memcpy(pr->title, title, titleSize);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement