why is this not working? It is in visual studo 2015, windows forms application C#
namespace guessing
{
public partial class Form1 : Form
{
Random rnd = new Random();
int rndm = rnd.Next(1, 13);
there is an error under rnd, which says:
"A field initializer cannot reference the non-static field, method, or property 'Form1.rnd' "
Aucun commentaire:
Enregistrer un commentaire