Make a C# program without using class

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sentimental37
    New Member
    • May 2010
    • 23

    Make a C# program without using class

    Hi everyone,
    Is there any way or trick to make a program that executes without using any class or class concept
  • PsychoCoder
    Recognized Expert Contributor
    • Jul 2010
    • 465

    #2
    My apologizes but I cannot understand what it is you're trying to accomplish, so can you clear this up for us :)

    Comment

    • sentimental37
      New Member
      • May 2010
      • 23

      #3
      thanks for the response. Actually this question just struck in my mind and i thought that can i make program without using the concept of class.

      Comment

      • rekedtechie
        New Member
        • Feb 2012
        • 51

        #4
        maybe no..

        because where i put the main() if dont have any class?

        how i compile my program, if dont have any class?

        csc.exe .cs? :)

        Comment

        • RhysW
          New Member
          • Mar 2012
          • 70

          #5
          Due to the processes c# goes through when it is executed it is impossibble to run code without a class, a class is what is executed and called upon when the program is running. without it there is no program.

          however you might be talking about making a program without a class library project, if you are then you can write a program without using a library, you could throw every part of the code in behind a form and its buttons, however, it is bad practice to do so, it is messy, and harder to debug and change, it also means the code is no longer re-useable.

          so to cover

          -Can i not have classes?
          No, you have to have atleast 1

          -Can i ignore class libraries?
          Yes but its bad to do so

          Rhys Whymark

          Comment

          Working...