sprintf(buf, "%s\r\n", affect_bit_name(race_table[ch->race].aff));
#include <stdio.h>
struct foo {
int a;
int b;
};
struct foo fooarray[3] = {
{1,2},{3,4},{5,6}
};
int main() {
printf("fooarray[2].b = %d\n",fooarray[2].b);
printf("(*(fooarray + 2)).b = %d\n",(*(fooarray + 2)).b);
}
Simple enough. Obviously, though, the output to the character is the affects in bit form.
I located the define for bits:
char *affect_bit_name (int vector)
if (vector & AFF_SPELLNAME) strcat (buf, " spellstring");
Tried doing:
Compile didn't like that statement: error: subscripted value is neither array nor pointer
I was kind of suprised I couldn't find a snippet for this, any help appreciated. When I wake up tomorrow,
I'll keep playing around with it.