From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,79e515de0ec64a7a,start X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2003-03-19 04:03:23 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: aputty@yahoo.com (Avi Putty) Newsgroups: comp.unix.tru64 Subject: problem using va_arg using stdarg.h Date: 19 Mar 2003 04:03:23 -0800 Organization: http://groups.google.com/ Message-ID: NNTP-Posting-Host: 212.241.151.129 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1048075403 29256 127.0.0.1 (19 Mar 2003 12:03:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 19 Mar 2003 12:03:23 GMT Xref: archiver1.google.com comp.unix.tru64:9733 Platform: V5.1 732 alpha Using gcc version 3.0.2 I am having a problem using va_arg function. I am including the stdarg.h header file. I perform the following: void foobarfunction(const char* name) { va_list ap; char* value; va_start(ap, name); value = va_arg(ap, char*); va_end(ap); printf("value = [%s] \n",(char*) value); } The program core dumps when I try to print out the contents. Am I using va_arg incorrectly or I am missing a step? Any help would be greately appreciated. Thanks. Avi