Join Gerry O'Brien for an in-depth discussion in this video Building functions that don't return a value, part of Learning C#.
So, we've already seen examples of main function.…This is a function that is existent in all of your C# console based applications.…And this is one that is written for you, specifically, by C#.…And you can include all kinds of different statements within that main function.…But, again, as we talked about, you want to start breaking…up the functionality of your application into these discrete pieces.…And this is where functions come into play.…And that they allow you to go ahead and do that.…What we're going to do here is create a non-returning function that…will concatenate two strings and then display the result to the screen.…
So, any time you create a function, it's always a good idea to give the…function a relatively friendly name and one that…describes what that function is going to do.…So, in this case, let's go ahead and create…the function, now, we're going to use a couple of different…key words here, mainly because of the way that…we're dealing with this class program and static void Main.…We're going to do a couple of keywords here that…
- Installing C#
- Working with loops
- Controlling program flow
- Using variables
- Building functions
- Creating and instantiating classes
- Catching errors
- Managing resources with the garbage collector
- Building collections
Skill Level Beginner
1. Introducing C#
2. C# Language Elements
3. Object-Oriented Programming in C#
4. Structured Exception Handling
5. Resource Management in C#
6. Extensible Types in C#
7. Windows Apps in C#
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.