Tag: Arrays

Difference between char [] and char * in C?

Generally, the following two statements about char[] and char * in C are considered confusing and understanding the difference between them is important. The first statement puts the literal string “mycplus” in read-only memory and copies the string to newly allocated memory on the stack. The second statement is known as static string allocation and definition.

Read More

Working with Pointers in C

A pointer is a variable that represents the location of a data item, such as a variable or an array element. Pointers are used frequently in C, as they have a number of useful applications. For example, pointers can be used to pass information back and forth between a function and its reference point. Pointers provide a way to return multiple data items from a function via function arguments to
be specified as arguments to a given function.

Read More

Arrays in C

In C Programming, an array can be defined as number of memory locations, each of which can store the same data type and which can be referenced through the same variable name. Arrays can be of two types i.e. One Dimensional Array (such as lists) and Multidimensional Arrays (such as tables or matrices).

Read More

Dynamic array of integers

An object of class DynamicArrayOfInt acts like an array with unlimited size. In the constructor, initially the data array has a size of 1 and grows as necessary. The method put(position, value); is used to store the value at the...

Read More

Insertion in Arrays

How to insert an element in an array at any point. And then print the updated array /******************************************************* * MYCPLUS Sample Code – https://www.mycplus.com * * * * This code is made...

Read More
  • 1
  • 2