Mail Archives: djgpp/2000/04/30/01:46:45
Joseph Rose wrote:
>
> Try:
>
> void Swap (void* A, void* B)
> {
> void* i=A
> A=B
> B=i
> return;
> }
Just for fun i tried this.
float abc[50][50];
float cba[50][50];
int main(void)
{
abc[1][2]=59.72;
swap(abc,cba);
printf("%f\n",abc[1][2]);
printf("%f\n",cba[1][2]);
return 0;
}
swap (void* A, void* B)
{
void* i=A;
A=B;
B=i;
}
This is the output:
59.720001
0.000000
so,IT DON'T WERK........
The real problem in this is that i need to
change the value of a constant pointer...
There has to be a way to do this.
--
|"""""<`.THE PRINCE ,'>"""""""""""""""""""""""""""""""""""|
| `.`/""""""\,',' my sig is too big, |
|SEE HIS ( / \ \' SEE HIS but its really cool. |
| FACE \/<> <>\/ SMILE |
| / W \ Visit my ascii art site: |
| ,'\_|||||_/`. http://www.gtcom.net/~krogg/ascii/ |
| ,',' ||| `.`. krogg DOT no DOT to DOT spam AT gtcom DOT net |
|____<,' TIME TO DIE `.>____Remove no.to.spam to reply____|
- Raw text -