Newsgroups: fj.lang.c
Path: galaxy.trc.rwcp.or.jp!coconuts.jaist!wnoc-tyo-news!aist-nara!wnoc-kyo-news!kuis-news!kudpc!sakunami!katahira!yagi!aoki
From: aoki@yamamoto.ecei.tohoku.ac.jp (Hideki Aoki)
Subject: About Memory Model
Message-ID: <1995Feb23.201138.26198@ecei.tohoku.ac.jp>
Lines: 63
Sender: news@ecei.tohoku.ac.jp
Nntp-Posting-Host: sleep
Organization: Departments of Electrical Engineering, Electrical Communications, Electronics Engineering, and Information Engineering, Faculty of Engineering, Tohoku University, Sendai, 980 Japan
X-Newsreader: mnews [version 1.17] 1994-01/27(Thu)
Date: Thu, 23 Feb 1995 20:11:38 GMT
Lines: 63
Xref: galaxy.trc.rwcp.or.jp fj.lang.c:1781
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.lang.c&nb=1781&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

  $B%9%b!<%k%b%G%k$G#6#4(BKByte$B0J>e$N(Bcomplex$B$r07$&G[Ns$r3NJ]$7$?$/$F2<5-$N%W%m%0%i%`$r:n(B
$B$j$^$7$?!#(B

  PC-9821Ap2$B>e$G(BBorlandC++Ver2.0$B$N%9%b!<%k%b%G%k$r;H$C$F2<5-$N%W%m%0%i%`$r%3%s%Q%$%k(B
$B$7$F<B9T$5$;$k$H!"(Bct=7$B$^$G$O(Bfarheapcheck()$B$G(B_HEAPOK$B$,JV$C$F$-$^$9$,!"(Bct=8$B$GI,$:(B
_HEAPCORRUPT$B$,JV$C$F$-$F!"F0:n$,IT0BDj$K$J$j$^$9!#(B

  $B$3$N%W%m%0%i%`$O%i!<%8%b%G%k$G%3%s%Q%$%k$7$?;~$K$O@5>o$KF0:n$7$^$7$?$,!"(B
$B2a5n$N;q;:$NET9g>e!"(Bstrcpy$B$J$I$rB?MQ$7$F$$$k$N$G!"%9%b!<%k%b%G%k$G%3%s%Q%$%k$r$7$?$$$N$G$9!#(B
$B$I$&$7$?$i%9%b!<%k%b%G%k$G!"$&$^$/F0:n$9$k%W%m%0%i%`$,=PMh$k$N$+$r65$($F$b$i$($J$$$G$7$g$&$+!#(B
$B<B:]$K$O(BX$B$NNN0h$r=PMh$k$@$19-$/(B($B6u$-NN0h0lGU(B)$B$H$j$?$$$H;W$C$F$$$^$9!#(B

$B$^$?!"(Bprintf()$B$G(Breal(x[ct]),imag(X[ct])$B$rI=<($5$;$F$$$k$H$3$m$G$O(B
$B$&$^$/(B(tm<8$B$G$O(B)$BI=<($7$F$$$k$N$G$9$,!"(BBorlandC$BImB0$N(Bdebuger$B$G$O(BWatch$B%&%$%s%I%&$G!"(B
X[ct]$B$rI=<($5$;$F$b!"$9$Y$F$N(Bct$B$G(B{0.0,0.0}$B$H$7$+I=<($5$l$:!"(Bprintf()$B$K$h$kI=<($HL7=b(B
$B$7$F$$$^$9!#(Ba$B$K4X$7$F$O(Bprintf()$B$H(BWatch$B%&%$%s%I%&$O$&$^$/@09g$7$F$$$^$7$?!#(B

#include<stdio.h>
#include<alloc.h>
#include<conio.h>
#include<complex.h>
#include<stdlib.h>

#define N 20
int main(void)
{

complex huge *X;
long ct;
complex a;

X=(complex huge *)farcalloc((long)N, sizeof(complex));
if(X==NULL)
{
printf("complex$B$rMQ0U$9$k$H$3$m$G%a%b%jITB-$G$9!*(B");
getch();
exit(1);
}
printf("FARHEAPCHECK=(%d)\n", farheapcheck());
for(ct=0;ct<N;ct++)
{
X[ct]=(complex)ct;
a=(complex)ct;
printf("&X[%ld]=%Fp", ct, &X[ct]);
printf(" X[%ld]=%.1lf +i %.1lf", ct, real(X[ct]), imag(X[ct]));
printf(" a=%.1lf +i %.1lf", real(a), imag(a));
printf(" ct= %ld FARHEAPCHECK=(%d)\n", ct, farheapcheck());
if(!(ct%5))getch();
}
return 0;
}

************************************************************
       $BElKLBg3XBg3X1!>pJs2J3X8&5f2J(B
       $B%7%9%F%`>pJs2J3X@l96(B $B;3K\8&5f<<(B M$B#1(B
       $B@DLZ(B $B=(<y(B (aoki@yamamoto.ecei.tohoku.ac.jp)
************************************************************






