Csharphub - csharphub.com - CSharpHub.com: Visual C# Development
General Information:
Latest News:
Find Out if a Given Number is Divisible by 3 in C# 6 May 2012 | 09:58 pm
To check if number is divisible by 3 or not you have to use the mode operator and if reminder is 0 it means it is divisible. using System; namespace ConsoleHub { class Programs { ...
Return Object of a Class from a Function in C# 6 May 2012 | 09:51 pm
You can return a object of a class from a method. This is simple program which is returning the object of share class. You can see that the class variable value is also returning. using System; name...
Return an Array from a Method in C# 6 May 2012 | 09:38 pm
This program is a example of returning an integer array from a method. Create an integer array in the function and return it. Remember that the function return type should be array of integer. using ...
C# Program to Pass int into a Function by Reference 6 May 2012 | 09:31 pm
This program help you to pass int value by reference and when you pass a value you can modify it inside function only. As you can see the output is 5 more than the privious value. using System; name...
Example to Use Class Inside Another Class in C# 6 May 2012 | 09:20 pm
You can have a class inside another class (nested class). The example of nested class is given below. The program also tells that how to use each class variable and create object of each class. The f...
Write Two Nested Namespaces in C# 6 May 2012 | 09:11 pm
You can write the nested namespaces in C#. The nested namespaces provide more facility to organize your classes and code. This program is a example of nested namespace and creating an object of class ...
How to Throw and Handle ArgumentException in C# 6 May 2012 | 09:00 pm
This program demonstrate the throwing a new exception of type ArgumentException. Just create a new exception and through it. to catch this type of specific exception specify in catch block. using Sys...
Char Array with foreach Loop in C# 5 May 2012 | 09:56 pm
This C# program is create a char array and then print the char array values using the foreach loop. The foreach loop start with first value of array and then iterate with all the values. The limitatio...
Initialize Char Array and Print in C# 5 May 2012 | 09:50 pm
The below program will help you to initialize the char array. While defining the array you can pass the set of value to directly initialize it. The for loop is used here to print the char array values...
Initialize a String Variable in C# 5 May 2012 | 08:39 pm
This program is showing different methods of initializing the given string variable. Case 1 is about initializing the string variable with empty string Case 2 is about initializing the string variab...