Mail Archives: djgpp/2000/04/30/04:06:46
Nate Eldredge wrote:
>
> Krogg <krogg DOT no DOT to DOT spam AT gtcom DOT net> writes:
>
> > Joseph Rose wrote:
> > >
> > > Try:
> > >
> > > void Swap (void* A, void* B)
> > > {
> > > void* i=A
> > > A=B
> > > B=i
> > > return;
> > > }
> >
> > Just for fun i tried this.
> [snip]
> > 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 solution is to make it not constant. Instead of `float
> foo[40][50]', you could do:
>
> float (*foo)[50];
> foo = malloc(40 * sizeof(*foo));
>
> You can then throw the pointers around as desired.
Cool,I partly grasp the idea,but how do i use the
array?
> This should probably go to comp.lang.c, since there's nothing
> DJGPP-specific about it, but oh well.
>
I thought that the solution might be nonportable and possible
Djgpp specfic,so i posted here.
Thanks by the way for the reply,I am trying to understand it,
but so far i am stuck a little....
--
|"""""<`.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 -