Autor Beitrag
winx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249



BeitragVerfasst: So 21.01.07 20:50 
Hallo,

ich möchte den folgenden Vergleich in C# schreiben, weiss aber nicht wie.
Der Code sieht so in Delphi aus:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
//csfframescan, state: integer;

if ((state and csfframescan) = csfframescan) then 
   m_FrameScan := true...


Wenn ich das so in C# übernehme bekomm ich immer den Fehler
"Error 25 Operator '&&' cannot be applied to operands of type 'int' and 'int' "

ausblenden C#-Quelltext
1:
2:
3:
4:
int state,csfframescan;

if ( ( state && csfframescan) == csfframescan)
    {...


Wie muß ich diesen "Byte" Vergleich in C# machen?

Danke!
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 21.01.07 20:54 
Ich finde, es ist nicht zu viel verlangt, selber zu schauen, welche Operatoren eine Sprache besitzt. :roll: Da wirst Du auf den "&"-Operator treffen, welcher in diesem Falle der Richtige ist.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
winx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249



BeitragVerfasst: So 21.01.07 20:58 
das das & ist is mir schon klar...

aber wie mach ich diesen byte vgl bei int werten???
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 21.01.07 21:00 
user profile iconwinx hat folgendes geschrieben:
das das & ist is mir schon klar...
Wieso benutzt Du ihn dann nicht?

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
winx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249



BeitragVerfasst: So 21.01.07 22:21 
sorry hab gedacht dass du auch && meinst, jetzt hab ich
mal nach nur einem & gesucht =>und das ist es...
lange leitung :-)

Danke!!!