|
-
July 2nd, 2008, 08:57 AM
#1
how to call a funtion...
hello,
i have a problem with c#, i´m new with these... Well, the problem is that i have a project with all my .cs and a library.dll that it is allready in the Debug folder. i have to run a function in learning.cs from my.cs, the code is this:
learning.cs
namespace PDL
{
public class C
{
.... code ....
public bool learn()
{
//the interest code//
}
}
In my.cs how can i call the function "public bool learn()" to start the code?
Thank u for ur time!
-
July 2nd, 2008, 09:51 AM
#2
Re: how to call a funtion...
First, you need to have entry point (Main() method), second, you need a instance of the class C:
Code:
C c = new C();
bool r = c.learn();
- Make it run.
- Make it right.
- Make it fast.
Don't hesitate to rate my post. 
-
July 2nd, 2008, 03:54 PM
#3
Re: how to call a funtion...
Or, you can make the 'learn' method static, and do the following:
Code:
bool b = C.learn();
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|