Jeg får denne meddelse (Fejl): ------------------------------------ Possibly incorrect assignment: if (ja_nej=\'ja\') ------------------------------------ Too few parameters in call to \'exit\' exit(); ------------------------------------
Var det ikke en ide at \"_getch()\" funktionen i stedet for scanf. Eks.
#include \"stdafx.h\" #include <conio.h>
int main(int argc, char* argv[]) { int tast;
printf(\"Tryk en tast\\n\"); tast = _getch();
if ((tast == 89) || (tast == 121)) // 89 = Y og 121 = y { printf(\"Du tastede Y eller y\"); } else { printf(\"Du tastede hverken \'Y\' eller \'y\'\\n\"); } return 0; }
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.