In message <mailman.136.1278040489.1673.python-l...@python.org>, Rami Chowdhury wrote:
> On Thursday 01 July 2010 16:50:59 Lawrence D'Oliveiro wrote: > >> Nevertheless, it it at least self-consistent. To return to my original >> macro: >> >> #define Descr(v) &v, sizeof v >> >> As written, this works whatever the type of v: array, struct, whatever. > > Doesn't seem to, sorry. Using Michael Torrie's code example, slightly > modified... > > char *buf = malloc(512 * sizeof(char)); Again, you misunderstand the difference between a C array and a pointer. Study the following example, which does work, and you might grasp the point: l...@theon:hack> cat test.c #include <stdio.h> int main(int argc, char ** argv) { char buf[512]; const int a = 2, b = 3; snprintf(&buf, sizeof buf, "%d + %d = %d\n", a, b, a + b); fprintf(stdout, buf); return 0; } /*main*/ l...@theon:hack> ./test 2 + 3 = 5 -- http://mail.python.org/mailman/listinfo/python-list