Prepare for your Next Interview
This is a discussion on Problem creating va_list variable on zLinux within the Unix/Linux forums, part of the Operating Systems category; Hi Guys, I have a problem creating va_list variable on zLinux platform. Here is the code that i had written to create va_list variable va_list INVALID_VA_LIST = NULL; va_list bar(void **...
|
|||
|
Hi Guys,
I have a problem creating va_list variable on zLinux platform. Here is the code that i had written to create va_list variable va_list INVALID_VA_LIST = NULL; va_list bar(void **vals) { int numvals=0; void **out=NULL; for (numvals = 0; vals[numvals]; ++numvals) {} out = (void **)malloc (numvals * sizeof (void *)); if (!out) return INVALID_VA_LIST; memcpy (out, vals, sizeof (void *) * numvals); return (va_list)out; } int main() { const char *lists[] = { "hi", "ho", "off we go", NULL }; va_list arglist = bar((void**)lists); char *vval; while((vval = va_arg(arglist, char *)) != NULL){ printf("%s\n",vval); } This use to work on Linux platform (Like Red Hat, Suse), but this is not working in zLinux platform and i could not find any work around for this, since i have to pass dynemic number of arguments to a function i want to create the va_list varialbe. As per some forums i have read that va_list in zLinux is a structure, can any one help me creating a va_list variable on zLinux platform. Thanks in advance... |
| Sponsored Links |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Parameter variable and Mapping variable | kiranmanju | Data Warehousing | 0 | 01-08-2008 03:17 AM |
| Linux Vs zLinux | psuresh1982 | Unix/Linux | 1 | 08-03-2007 01:53 PM |
| Major problem while creating universe in real time | Geek_Guest | Data Warehousing | 0 | 07-04-2007 11:47 PM |
| Normal Variable and the Comp-3 Variable in Cobol | Geek_Guest | MainFrame | 0 | 07-04-2007 08:47 PM |
| redefine a variable | Geek_Guest | MainFrame | 1 | 05-18-2007 03:57 PM |