I want this function (which is a part of a larger program) to read a bunch of letters (they will all be different letters) and assign the index of that letter in the array to carry the value TRUE. there are two arrays i want to do this do: set_A and set_B.
actually, i made an enumeration type earlier in the program which defines all lowercase letters as type letters. it was necessary that i use the enum type.
This is not working properly at all. It compiles but doesnt do what i want it to. i think the main problem is in the bold parts.
actually, i made an enumeration type earlier in the program which defines all lowercase letters as type letters. it was necessary that i use the enum type.
This is not working properly at all. It compiles but doesnt do what i want it to. i think the main problem is in the bold parts.
Code:
void getArray(bool set_A[],bool set_B[]) { letters let; for (let=a; let<=z; let++) { set_A[let]=FALSE; set_B[let]=FALSE; } printf("Enter the string of letters for Set A: "); [B]while((let=getchar()) != EOF) { set_A[let]=TRUE; }[/B] printf("\nEnter the string of letters for Set B: "); [B]while(( let=getchar()) != EOF) { set_B[let]=TRUE; }[/B] }
Comment