How to include one c# file into another c# file? -



How to include one c# file into another c# file? -

how include 1 c# file c# file?

i have 2 c# file 1 test.cs , 1 main.cs. want include test.cs main.cs.

test.cs file code

// can utilize console.writeline debugging using system; using system.collections.generic; using system.collections; using system.linq; using system.text; using system.threading.tasks; class solution { public bool solution(long number1, int[,] arr1,int dim_2,int dim_3) { //some code here } }

main.cs code

using system; include test.cs; class grouping { public static void main(string[] args) { long number1 = 5; int [,] arr1 = new int[,] {{0, 0},{1, 1},{2, 2},{3, 3},{4, 4}}; int dim_2 = 5; int dim_3 = 2; solution object_class = new solution(); bool result = object_class.solution ( number1, arr1, dim_2, dim_3 ); console.writeline("return :"); console.writeline( result ); } }

what doing wrong here?? please help me.

thank in advance

i guess problem because both files not added in same project.

if using visual studio.

to add together test.cs in grouping class project.

go solution explorer -> add together existing item -> browse file i.e. test.cs -> ok

if using dos mode.

make sure both files must in same folder.

and in either case. first delete include test.cs; main file. compile & run

c#

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -