This repository has been archived on 2023-04-18. You can view files and clone it, but cannot push or open issues or pull requests.
iaj/TP1/Prolog/AidesCPP/2.cpp
2023-02-01 10:19:02 +01:00

17 lines
346 B
C++

#include <SWI-cpp.h>
#include <cstdio>
// swipl-ld -ld g++ -goal true 2.cpp 2-f.pl
// attention, recompile nécessaire si 2-f.pl change
int main(int _ac, char **_av) {
PL_initialise(_ac, _av);
PlTermv pl_args2(1);
PlQuery q0("f", pl_args2);
while (q0.next_solution()) {
printf("---> %s\n", (char *)pl_args2[0]);
}
return 0;
}