1/21
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
array
A kind of data structure that can store multiple values of the same data type using a single variable and is used to store a collection of data.
index.
Accesses a specific element in an array.
Initializing Arrays
refers to declaring an array alongside the data that it will contain.
Base Index
Refers to the 1st element of an array with an index of zero [0].
Sorting
a process of ordering individual elements of a list according to their proper rank, either in ascending or descending order.
Bubble Sort
works by comparing each array element compared to every other array element.
If a value is larger / smaller than another, the values are swapped.
Two-Dimensional Array
The simplest form of multidimensional array, it is a list of one-dimensional arrays.
data type array Name [rows][columss];
Syntax: Two-Dimensional Array
Three-Dimensional Array
Is a collection of 2D arrays
as a pointer
as a sized Array
As an unsized away
There are 3 ways to pass a single-dimension array as an argument to functions by declaring them as formal parameters
strings
is a data type used in programming, such as an integer
and floating-point unit, but is used to represent text/character
rather than numbers.
strings
is comprised of a set of characters treated as a single unit that
can also contain spaces and numbers.
strings
is an array of characters ending in the null character
(‘\0’).
scanf
function only takes the first entered word. The
function terminates when it encounters a white space (or just space).
strlen()
strcpy()
strcmp()
strcat()
the commonly used string functions and are
defined in the ‘#include<string.h>’ header file/string library:
strlen()
calculates the length of a given string.
strlen()
function takes a single argument, i.e, the string variable
whose length is to be found, and returns the length of the string
passed.
strcpy()
copies the string to another character array.
Strcpy()
copies the string pointed by source
(including the null character) to the character array destination,
which returns the character array destination.
strcmp()
compares two strings and returns 0 if both
strings are identical.
strcmp()
compares two strings character by character. If the
first character of two strings are equal, next character of two
strings are compared. This continues until the corresponding
characters of two strings are different or a null character '\0' is
reached.
strcat()
compares two strings character by character. If the
first character of two strings are equal, next character of two
strings are compared. This continues until the corresponding
characters of two strings are different or a null character '\0' is
reached.