| delorie.com/archives/browse.cgi | search |
| Message-ID: | <390BBF21.41DAF825@gtcom.net> |
| From: | Krogg <krogg DOT no DOT to DOT spam AT gtcom DOT net> |
| X-Mailer: | Mozilla 4.61 [en] (Win95; U) |
| X-Accept-Language: | en,en-US,en-GB,ja,af |
| MIME-Version: | 1.0 |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Array swapping. |
| References: | <390B75BB DOT 621F846A AT gtcom DOT net> <be7ngssbe6fnhur5if8j27a3ct35gpj2e9 AT 4ax DOT com> <390BAB86 DOT 7C1EF855 AT gtcom DOT net> <390BBCF8 DOT 27D2D2AC AT pop DOT gis DOT net> |
| Lines: | 58 |
| Date: | Sun, 30 Apr 2000 01:05:37 -0400 |
| NNTP-Posting-Host: | 12.16.179.81 |
| X-Trace: | eagle.america.net 957071329 12.16.179.81 (Sun, 30 Apr 2000 01:08:49 EDT) |
| NNTP-Posting-Date: | Sun, 30 Apr 2000 01:08:49 EDT |
| Organization: | 24hoursupport.com |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
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____|
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |