Dill Build Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm working on doing a DLL that will give me back random numbers. He is what
I have.


using System;

namespace dieroll
{
public class dieroll : Object

int[] diearray = new int[6];
void RollDie (int count)
{
int x=1;
while (x <= count)
{
diearray [x] = randomNumber.Next(1,8);
x++;
}
}
}
}

When I build it I get {expected
and a Red Line after the public class dieroll : Object

New to this any help would be great!!
 
KAnoe said:
I'm working on doing a DLL that will give me back random numbers. He is what
I have.


using System;

namespace dieroll
{
public class dieroll : Object

int[] diearray = new int[6];
void RollDie (int count)
{
int x=1;
while (x <= count)
{
diearray [x] = randomNumber.Next(1,8);
x++;
}
}
}
}

When I build it I get {expected
and a Red Line after the public class dieroll : Object

New to this any help would be great!!

Well, you've got both a namespace *and* a class called dieroll, which
is a bad idea to start with - give them different names.
 
Isn't it supposed to be object instead of Object??


Jon Skeet said:
KAnoe said:
I'm working on doing a DLL that will give me back random numbers. He is what
I have.


using System;

namespace dieroll
{
public class dieroll : Object

int[] diearray = new int[6];
void RollDie (int count)
{
int x=1;
while (x <= count)
{
diearray [x] = randomNumber.Next(1,8);
x++;
}
}
}
}

When I build it I get {expected
and a Red Line after the public class dieroll : Object

New to this any help would be great!!

Well, you've got both a namespace *and* a class called dieroll, which
is a bad idea to start with - give them different names.
 
Also you need a closing brace after the class declaration.


Jon Skeet said:
KAnoe said:
I'm working on doing a DLL that will give me back random numbers. He is what
I have.


using System;

namespace dieroll
{
public class dieroll : Object

int[] diearray = new int[6];
void RollDie (int count)
{
int x=1;
while (x <= count)
{
diearray [x] = randomNumber.Next(1,8);
x++;
}
}
}
}

When I build it I get {expected
and a Red Line after the public class dieroll : Object

New to this any help would be great!!

Well, you've got both a namespace *and* a class called dieroll, which
is a bad idea to start with - give them different names.
 
Sushant Bhatia said:
Isn't it supposed to be object instead of Object??

That makes no difference at all - object is just a shorthand for
System.Object.
 
Not to mention an opening brace after the class declaration, which is the
cause of the error.

Steve

Sushant Bhatia said:
Also you need a closing brace after the class declaration.


Jon Skeet said:
KAnoe said:
I'm working on doing a DLL that will give me back random numbers. He is
what
I have.


using System;

namespace dieroll
{
public class dieroll : Object

int[] diearray = new int[6];
void RollDie (int count)
{
int x=1;
while (x <= count)
{
diearray [x] = randomNumber.Next(1,8);
x++;
}
}
}
}

When I build it I get {expected
and a Red Line after the public class dieroll : Object

New to this any help would be great!!

Well, you've got both a namespace *and* a class called dieroll, which
is a bad idea to start with - give them different names.
 
Back
Top