Hallo,

die Funktionen haben einen Rückgabewert (Variable)! Der wird direkt in der if Bedingung ausgewertet. Ist in C egal ob ich nun schreibe
int x = funktion();
if(x) {}

oder
if(funktion()) {}

... aber nur sofern x später nicht mehr gebraucht wird natürlich.


Und warum braucht man bei if(strcmp(receiveBuffer, "Ein")==0) das "==0", was soll denn da 0 sein?
siehe Link weiter oben

http://www.cplusplus.com/reference/c...string/strcmp/

Returns an integral value indicating the relationship between the strings:
A zero value indicates that both strings are equal.
A value greater than zero indicates that the first character that does not match has a greater value in str1 than in str2; And a value less than zero indicates the opposite.
0 heisst gleich. Alles andere nicht.

MfG,
SlyD