C# Params Array

Sometimes a situation may arise where you do not know how many parameters you want to pass to a method or you may want the method to accept n number of parameters at runtime. In such times params type array can solve the problem. param is a keyword in C# that creates an array at … Read more

C# Passing Array to Function

In this tutorial, we will learn how to pass an array to function in C#. Before that you need to have an idea on following topics in C#. Function in C# C# Arrays We use a function to reuse a block of code in a program. And we can pass an array to the function … Read more

C# Jagged Arrays

Jagged Arrays are also known as “array of arrays” that is because the elements are arrays themselves. Their dimensions and sizes may be different. Declaration of jagged array in C#. Jagged array can be declared and created in a following way. Initialization of Jagged array in C# As told above, a jagged array can be … Read more

C# Multidimensional Arrays

C# allows multi-dimensional arrays. This could be of 2D or 3D (two-dimensional or three-dimensional) Array. These arrays are stored in the form of a table (with rows and columns) which is also known as a matrix. In C#, multidimensional array is also known as rectangular arrays. To declare an array of multi-dimensions, we need to … Read more

C# Arrays

You must have learned C, C++, Java, etc and like any other programming language, an array in C# is also a group or a fixed-size sequential collection of data having the same data-type stored in a contiguous memory location. The are used to store multiple values in a single variable instead of creating multiple variable for … Read more

C++ Return Array from Functions

C++ allows us to return the arrays from a function. However the actual array values cannot be returned, so we return the array from the function with the help of pointers. Pointers are the variables that hold an address. With the help of pointers, the address of the first element is returned from a function. … Read more

C++ Multidimensional Arrays

C++ allows Multi-Dimensional Arrays. This could be of 2D or 3D (two-dimensional or three-dimensional) Array. These arrays are stored in the form of a table (with rows and columns) which is also known as a matrix. In C++, multidimensional array is also known as rectangular arrays. Syntax of multi-dimensional array: The data-type must be a … Read more

Passing Array to a Function in C++

In C++, passing an array to a function in the one-Dimensional array is done through an actual parameter and array variables with subscript are passed as formal arguments. While passing the array only the name of the array is passed to the function. Same method is applied for the multi-dimensional array. The syntax for passing … Read more

C++ Arrays

An array is a group or a fixed-size sequential collection of data having the same data-type stored in a contiguous memory location. It is a simple data structure format where the primitive type of data such as int, char, double, float, etc are stored and accessed randomly through their index number such as array[0], array[1], etc. … Read more

C++ Recursion

Recursion refers to the process when a function calls itself inside that function directly or indirectly or in a cycle. And such functions are called recursive functions. However, the crucial part is the termination condition, if not handled properly then it might go into an infinite loop. We can use the if…else statement to stop … Read more