salve a tutti...in questo programma mi dà un errore alla riga 57, che non riesco a risolvere..mi dice incompatible types in assignment..come posso risolvere?
codice:
#include <stdio.h>
#define DIMENSIONE_VETTORE 20
typedef enum {FALSE, TRUE} BOOLEAN;
typedef char String[20];
typedef struct {int identificatori; String stringhe;} StringPool;
StringPool sp[DIMENSIONE_VETTORE];
int add (int identifier, String str);
int main()
{
int identificatore,valore_sentinella,i;
String stringa;
for(i=0;i<DIMENSIONE_VETTORE;i++)
sp[i].identificatori = -1;
valore_sentinella = 1;
while(valore_sentinella == 1){
printf("Inserire identificatore: ");
scanf("%n", &identificatore);
printf("/n");
printf("Inserire stringa: ");
scanf("%s", &stringa);
printf("/n");
if(add(identificatore, stringa) == TRUE)
printf("Inserimento riuscito.../n");
else
printf("Inserimento errato.../n");
printf("Continuare con l'inserimento? (premere 1 per SI / premere 0 per NO ");
scanf("%d", &valore_sentinella); }
system("pause");
return 0;
}
int add (int identifier, String str)
{
int i;
if(identifier > 0 && str!=""){
for(i=0;i<DIMENSIONE_VETTORE;i++){
if(identifier == sp[i].identificatori) return FALSE;
else for(i=0;i<DIMENSIONE_VETTORE;i++){
if(sp[i].identificatori == -1){
sp[i].identificatori = identifier;
sp[i].stringhe = str; }}}
else return FALSE; }
}