Non capisco non mi da errori di sintassi o cose del genere, ma appena faccio partire l'eseguibile mi dice che ha smesso di funzionare e si spegne...questo è il codice:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef unsigned int boolean;
#define false 0
#define true 1
struct list {
int code;
struct list *next_ptr;
};
struct project {
char name[81];
struct list *ptr;
};
void print_project(struct project *V, int N, int code) {
int count;
boolean found;
found = false;
while (found == false) {
for (count = 0; count < N; count++) {
if (V[count].ptr->code == code)
found = true;
}
}
if (found == true)
printf("Il progetto si chiama %s", V[count].name);
else
printf("Lo studente con matricola %d non partecipa ad alcun progetto",
code);
}
int main() {
struct project V[10];
strcpy(V[0].name, "Leonardo");
V[0].ptr->code = 5269075;
strcpy(V[1].name, "Galileo");
V[1].ptr->code = 5254739;
strcpy(V[2].name, "Giotto");
V[2].ptr->code = 5125496;
print_project(V,3,5254739);
system("pause");
return 1;
}
scusate il disturbo...ma non riesco a capire!