Geeks Talk

Prepare for your Next Interview




Problem creating va_list variable on zLinux

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 **...


Go Back   Geeks Talk > Operating Systems > Unix/Linux

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-25-2008
Junior Member
 
Join Date: Mar 2008
Location: India
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
rakeshcs123 is on a distinguished road
Post Problem creating va_list variable on zLinux

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...
Reply With Quote
Sponsored Links
Reply

  Geeks Talk > Operating Systems > Unix/Linux


Thread Tools
Display Modes


Similar Threads

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


All times are GMT -4. The time now is 01:52 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved