Only just started learning how to code, so it is very simple and perhaps incorrect on many levels.Have tried to find the answer online but can't seem to correct the problem so thought i would ask here :).
The problems seem to be on Line 18: warning: comparison between pointer and integer Line 22: error: expected expression before 'else'
What am I doing wrong is there a better way of doing this?
Thank's for reading this Peace
#include <stdio.h>
int main(void){
char pname [25];
char Y [1];
char N [1];
char choice[1];
printf("when responding to Yes or No questions use Y/N.\n");
printf("Hello,traveler Welcome to the Castle of Atal....What is your name?\n");
scanf ("%s",&pname);
printf("Greeting's %s What bring's you to the kingdom of Tharnos?\n",pname);
printf("I see how intresting do you wish to enter %s ?\n",pname);
scanf ("%c",&choice);
if (choice == 'Y');
{
printf ("Enter %s...\n",pname);
}
else (choice == 'N');
{
printf ("Farewell lost soul!\n");
}
return 0;
}
Aucun commentaire:
Enregistrer un commentaire