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

malloc, once again

Name: Anonymous 2010-11-03 8:25

I have a struct like
typedef struct { char* dildo; int etc } anus;.
Later on I want to make an anus array, with dildo being a string entered by the user.
Now how do I reserve the memory for dildo in my anus array?

So far I have:

typedef struct { char* dildo; int etc } anus;
...
char* small_dildo = fancy_input_routine();
anus* anii = (anus*) malloc(array_size * sizeof(anus));

With that I can't memcpy any small_dildo into my anii obviously, however I'm not quite sure how to do it.

Name: Anonymous 2010-11-03 19:02

1. Bytes are not necessarily 8 bit.
2. Characters are not necessarily bytes.
3. C/C++ char is a bullshit data type which more closely related to bytes than to characters.

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