Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to create function in c# ?

how to create function in c# ?

Scheduled Pinned Locked Moved C#
csharptutorialquestion
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xingselex
    wrote on last edited by
    #1

    in VB . a class can have constructor and funstion or sub. so how to create a function return a value in C# class ?

    M L D L 4 Replies Last reply
    0
    • X xingselex

      in VB . a class can have constructor and funstion or sub. so how to create a function return a value in C# class ?

      M Offline
      M Offline
      musefan
      wrote on last edited by
      #2

      you lazy little *&^@! use google[^]

      Life goes very fast. Tomorrow, today is already yesterday.

      L 1 Reply Last reply
      0
      • X xingselex

        in VB . a class can have constructor and funstion or sub. so how to create a function return a value in C# class ?

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi, both subroutines and functions are called methods in C#; they may or may not return one value or reference, depending on the return type in the declaration. Same as in C, C++, Java, and a lot of other languages (except they often are called functions, with or without a return value). I suggest you buy and study a tutorial on C# so you can reach structured and illustrated knowledge in minimal time. :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


        1 Reply Last reply
        0
        • M musefan

          you lazy little *&^@! use google[^]

          Life goes very fast. Tomorrow, today is already yesterday.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          musefan wrote:

          you lazy little *&^@!

          lol! +5

          Check out the CodeProject forum Guidelines[^]

          1 Reply Last reply
          0
          • X xingselex

            in VB . a class can have constructor and funstion or sub. so how to create a function return a value in C# class ?

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            Seriously, this is a C# 101 class question. Pickup a beginners book on C# and work through it. It'll answer just about all of your basic questions like this.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            1 Reply Last reply
            0
            • X xingselex

              in VB . a class can have constructor and funstion or sub. so how to create a function return a value in C# class ?

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Epic fail. How can you be asking about events first and only after that want to return values? Obviously something is wrong here. I think you're some gold member who thinks it's funny to ask crazy questions on purpose. And if that's true, well, ok it would be funny I suppose.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups