Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. typedef struct {
  2. char *string;
  3. } prod_t;
  4.  
  5. int
  6. main(int agrc, char **argv){
  7. int i = 0;
  8. prod_t *c = NULL;
  9.  
  10. char str2[100] = "abcd";
  11. c->string = (char *) malloc( 5 * sizeof(char));
  12. strcpy(c->string,str2);
  13.  
  14. compares(c->stock,str2,i);
  15.  
  16. return 0;
  17. }
  18.  
  19. prod_t *c = malloc(sizeof(prod_t));
  20.  
  21. prod_t *c = malloc(sizeof(prod_t));
  22.  
  23. c->stock
  24.  
  25. typedef struct {
  26. char *string;
  27. } prod_t;
  28.  
  29. int
  30. main(int agrc, char **argv) {
  31. int i = 0;
  32. prod_t *c = malloc( sizeof( prod_t ));
  33.  
  34.  
  35. char str2[100] = "abcd";
  36. c->string = malloc( 5 * sizeof(char));
  37. strcpy(c->string,str2);
  38.  
  39. compares(c->string,str2,i);
  40.  
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement