#include <stdio.h>
#include <string.h>
int main(void){
int choice,don,i,n,numdon=0,numreq=0 ;
char dontype[100][20],reqtype[100][20],temptype[20] ;/*issue here?*/
int donamount[100],donamt,reqamount[100] ;
if (choice==1)
{
printf("How many donations do you have?\n");
scanf("%d",&don);
for (i=don;i<don;i++)
{
printf("\nPlease enter your donation type.\n");
scanf("%s",&temptype[i]);
printf("Please enter your donation amount.\n");
scanf("%d",&donamt);
if (numdon==0)
{
(strcpy(dontype[i],temptype[i]));
donamount[i]=donamt;
numdon++;
printf("Donation added.\n\n");
}
else if (numdon > 0)
{
for (n=0;n<numdon;n++)
{
if (strcmp(temptype[i],dontype[n])== 0)
{
donamount[n]=donamount[n]+donamt);/*issue here?*/
numdon++;
printf("Donation added.\n\n");
}
else if (strcmp(temptype[i],dontype[n])!= 0)
{
strcpy(dontype[i],temptype[i]);/*issue here?*/
donamount[i]=donamt;
numdon++;
printf("Donation added.\n\n");
}
}
}
}
}
I feel like the answer is right under my nose as always, but I'm just so burnt out right now!
Thanks- as always- for the help.

New Topic/Question
Reply




MultiQuote





|