Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C Structs

Name: Anonymous 2009-03-24 12:22

Hi fags.

I need to know how portable c structs are for data transmission: are the fields in a fixed position determined by some standard?

Name: Anonymous 2009-03-26 21:06

>>56
actually, why not do this instead?
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>

char *strdupv(int count, ...)
{ va_list ap;
  char *r = NULL, char *s[count];
  int i, n = 0;
  va_start(ap, count);
  for(i = 0; i < count; n += strlen(s[i++])) s[i] = va_arg(ap, char *);
  va_end(ap);
  r = malloc(n + 1);
  if(r) for(*r = i = 0; i < count; ++i) strcat(r, s[i]);
  return r; }

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List