AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

pointer to an array in D und C++

Ein Thema von Virchov · begonnen am 19. Mär 2004 · letzter Beitrag vom 19. Mär 2004
 
Virchov

Registriert seit: 15. Mär 2004
Ort: Bäärlin
109 Beiträge
 
#1

pointer to an array in D und C++

  Alt 19. Mär 2004, 09:29
Moin!

Ich habe versucht, diese funktion in deplhi zu übersetzen. Alles klappt in die Zeile BinImgPlus[idx]=0; Kann man pointer auf array in Delphi so nicht deklarieren? Ich möchte aber in Delphi die array-Struktur beibehalten. Geht das?

Vielen Dank!

Delphi-Quellcode:

int BinImgMatchProMile(
  const bool* BinImg1,
  const bool* BinImg2,
  int nElements,
  bool* BinImgPlus,
  bool* BinImgMinus)
{
  //local declares
  register idx, MatchCounter=0;

  //calculations
  for (idx=0; idx<nElements; ++idx){
    //local initialisation
    BinImgPlus[idx]=0;
    BinImgMinus[idx]=0;
    //Find out what to do for this element
    if (BinImg1[idx]==BinImg2[idx])
      //Got a match in case BinImg1 == BinImg2
      MatchCounter++;
    else if (BinImg1[idx] && (!BinImg2[idx]))
      //Got positive difference in case BinImg1 > BinImg2
      BinImgPlus[idx]=1;
    else if (BinImg2[idx] && (!BinImg1[idx]))
      //Got negatice difference in case BinImg1 < BinImg2
      BinImgMinus[idx]=1;
    //endif
  }

  return (int)(((float)MatchCounter/(float)nElements)*1000.0);
}
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:42 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz