void refarray(char * &arraybuff[])
{
char *s1="hello";
char *s2="everybody";
arraybuff[0]=s1;
arraybuff[0]=s2;
}
void main()
{
char* getarray[2];
refarray(&getarray[]);
printf("%s %s",getarray[0],getarray[1]);
}
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Oct 28, 2012, 12:16 PM
void refarray(char *arraybuff[])
{
char *s1="hello";
char *s2="everybody";
arraybuff[0]=s1;
arraybuff[1]=s2;
}
void main()
{
char *getarray[2];
refarray(getarray);
printf("%s %s",getarray[0],getarray[1]);
}
As expected, the output is:
hello everybody