Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixed up the recent code examples for style

...

Code Block
bgColor#FFCCCC
langc
#include <stdlib.h>
 
typedef struct gadget gadget;
struct gadget {
  int i;
  double d;
  char *p;
};
 
typedef struct widget widget;
struct widget {
  char *q;
  int j;
  double e;
};
 
struct gadget *gp;
struct widget *wp;
 
/* ... */
 
wp = (struct widget *)realloc(gp, sizeof(struct widget));
if (wp->j = 12) {
  /* ... */
}

...

Code Block
bgColor#ccccff
langc
 
#include <stdlib.h>
#include 
typedef struct gadget gadget;<string.h>
 
struct gadget {
  int i;
  double d;
  char *p;
};
 
typedef struct widget widget;
struct widget {
  char *q;
  int j;
  double e;
};
 
struct gadget *gp;
struct widget *wp;
 
/* ... */
 
wp = (struct widget *)realloc(gp, sizeof(struct widget));
memset(wp, 0, sizeof(struct widget));
/* ... */
if (wp->j = 12) {
  /* ... */
}

...