Ich habe dieses Problem in einem Buch gefunden.Kann mir bitte jemand die Ausgabe von C-Programm erklären?
Problem:
Was ist die Ausgabe des folgenden Programms?
#include <stdio.h>
int fun(int,int);
typedef int(*pf) (int,int);
int proc(pf,int,int);
int main()
{
printf("%d\n",proc(fun,6,6));
return 0;
}
int fun(int a,int b){
return (a==b);
}
int proc(pf p,int a,int b){
return ((*p)(a,b));
}
Dieser Code, wenn ausführen, druckt 1.
heraus habe ich versucht, es zu verstehen, aber nein, es ist nichts. Was läuft in diesem Programm und warum gibt es 1 aus?
Vielen Dank im Voraus.
Diese wie Hausaufgaben – Petesh
Die Antworten auf mich aussieht, ist: '0'!. – leppie