Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newB- console app -how to get different files to run one after another 1

Status
Not open for further replies.

Gzk2010

Programmer
Aug 17, 2010
48
US
I have a file Unsafe_Acess.cs class name "class unsafe" in a vs 2008 console app. I also then have a class file named UnmanagadCode.cs with a class in int "class unmanagadeCode".
How can I start get Unsafe_Acess.cs to run and then autimatically UnmanagadCode.cs to run.


sorry for the so easy question .
thanks in advance
 
you wouldn't execute these files, you would compile them and, possibly, instantiate objects defined in these files.
Code:
class Foo()
{
   public void DoThis() {...}
}

class Bar()
{
   public void DoThat() {...}
}
Code:
new Foo().DoThis();
new Bar().DoThat();

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
should I code
Code:
 new Foo().DoThis();new Bar().DoThat();
from another .cs file that inherits Foo() and Bar() and then use their methods DoThis() and DoThat() from there?
 
i don't understand the question.
an object can inherit a single class and multiple interfaces. an object cannot inherit multiple classes.

if you mean have a 3rd class instantiate Foo and Bar and have that class call there members... it's possible to do that. whether it's needed or not is a question of design.

I don't understand why you are thinking in terms of files. files are just a convenience for the developer. it's all compiled into code. Typically you have an object per file, but that's not always the case. You need to think in terms of objects and how they relate.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top