Im trying to make a confirm function where the user types either Y for yes or N for no to confirm that they wish to make changes. My code is as follows however it doesn't work.
if((strcmp(array[0], "export")==0))
{
printf("\nPlease Confirm you wish to change [%s] to %s ",myarg[1], myarg[2]);
conf = 0;
end = 0;
while(end != 1)
{
printf("Type Y for Yes or N for No");
temp = getchar();
if (temp = "Y")
{
con = 1;
end = 1;
}
if (temp = "N")
{
con = 0;
endk = 1;
}
}
}
if((strcmp(array[0], "export")==0))
{
printf("\nPlease Confirm you wish to change [%s] to %s ",myarg[1], myarg[2]);
conf = 0;
end = 0;
while(end != 1)
{
printf("Type Y for Yes or N for No");
temp = getchar();
if (temp = "Y")
{
con = 1;
end = 1;
}
if (temp = "N")
{
con = 0;
endk = 1;
}
}
}