When I am trying to compile, it says that it is done but when I try to run the program it says that it is not compiled. I tried to track down the problem. From what I was seeing, it turns out that the problem is with the scanf. I tried using it with and without ampersand but it doesn't work.
Here is a sample of the code:
#include<stdio.h>
#include<stdlib.h>
int main()
{
char p1[10], p2[10], ........ ;
printf("Welcome!\n");
printf("Enter R for Rock, S for Scissors, and P for Paper\n");
printf("\n");
printf("Please enter the name for player 1: ");
scanf("%9s", &p1);
printf("Please enter the name for player 2: ");
scanf("%9s", &p2);
........
system("PAUSE");
return(0);
}
I am using the latest version of Orwell on Windows 8.1.
P.S. I still new to programming :p
Any help? Thanks!
Good job on being aware of array overflow issues! Just... don't skimp on name length. Give those names more space, like 50 or 100 characters. And if you really want to be careful about inputs, make sure to synchronize by ignoring anything extra the user typed before pressing Enter:
Thanks for the tip! Anyways, do you think that orwell has a problem with win 8.1? I still can't compile the script if the scanf is still in the code :(