Forums - Music techology
Subject: How do I program ;
Viewing all 6 messages - View by pages of 10: 1
Original Message 1/6 13-Sep-98 @ 12:26 AM - How do I program ;
as well ask. Any C or C++ programmers know how a function can
take in 3 values a,b,c and return the values as c,b,a ??
I don't understand this because I thought a function can only return
one value at a time.
Here' the question as asked:
Write a function that will return the numbers in reversed order; i.e.
a,b,c, will now be printed c,b,a, on return from the function.
Anybody understand this.
I know this is way off topic but its better than a stupid comment.
Thanks
Message 2/6 13-Sep-98 @ 01:19 AM - RE: How do I program ;
Message 3/6 13-Sep-98 @ 01:51 AM - RE: How do I program ;
Message 5/6 13-Sep-98 @ 02:15 PM - RE: How do I program ;
BUT... I really think this kind of conversation doesn't belong here, there are lots of nice newsgroups and sites dedicated to programming.
Message 6/6 14-Sep-98 @ 11:34 AM - RE: How do I program ;
void ReverseOrder(int *a,int *b,int *c)
{
// b is not really needed now is it!
int dummy;
dummy=*c;
*c=*a;
*a=dummy;
}
now suppose you have int variables d,e,f
you would call the procedure like:
.. bla
int d=3;
int e=5;
int f=7;
ReverseOrder(&d,&e,&f);
//d=7, e=5, f=3
Viewing all 6 messages - View by pages of 10: 1
There are 6 total messages for this topic
Reply to Thread
You need to register/login to use the forum.
Click here to Signup or Login !
[you'll be brought right back to this point after signing up]
Back to Forum