1# include conio.h
2# Avoid using goto! change "goto endprogram;" to "return 0;"
3# Change the start lable to a while(1) cicle and at the end change "if(newga == 1) goto start;" to "if(newga != 1) break;" (leave the cicle).
4# You code to read the word from the 1st user would crash if he inserts more than 15 chars. Use fgets(guessed,sizeof(guessed),stdin);
But if you don't want the 2nd user to see the word leave the cicle how it is, add a check to verify is the's enough space in the buffer, and end when '@' is read.
4# Add you error increment here :
Code:
//your code
for(a = 0; a<= getguess; a++){
if (guess == guessed[a]){
progress [a] = guess;
}
}
//declare at the beginnig a new var
int main(){
int is_char_guessed;
/*...*/
//add a check at the end of the cicle
is_char_geuessed = 0;
for(a = 0; a<= getguess; a++){
if (guess == guessed[a]){
progress [a] = guess;
is_char_guessed = 1;
}
}
if(!is_char_guessed)
text++;
Your code has a big problem. If user 1 inserts more than 15 chars, user2 never wins.