[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] compiler bug?



>
> > Ja som regel er den en selv der bøffer, men nu
> omskrev
> > jeg ikke på funktion, jeg flyttede den bare ud af
> > klassen (og ændrede på prototypen bevares) og det
> > fixede problemet. Det er det jeg finder mystisk.
> >
> >
> Ja, men det at du flyttede den og ændrede typen har
> betydning for
> hvornår og hvordan den variable bliver defineret.
> Det kan så have
> betydning for om en evt. fejl har eller ikke har en
> effekt.
> 
Det forstår jeg ikke. Hvad skulle forskellen være på:

CMatrix CMatrix::operator*(CMatrix& A)
{
  int i,j,k;
  CMatrix R;

  for (i=0;i<N;i++)
    for (j=0;j<N;j++)
      for (k=0;k<N;k++)
	R.m[i][j][k]=(this->.m[i][j][k])*A.m[i][j][k];

return R;
}

og så:

CMatrix operator*(CMatrix& B, CMatrix& A)
{
  int i,j,k;
  CMatrix R;

  for (i=0;i<N;i++)
    for (j=0;j<N;j++)
      for (k=0;k<N;k++)
	R.m[i][j][k]=A.m[i][j][k]*B.m[i][j][k];

return R;
}

Jeg praler ikke af at være en speciel ørn til C++, men
så vidt jeg har kunne læse mig til har man frit valg.

-Sune

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *