1/15
These flashcards cover fundamental concepts related to arrays and strings in C programming based on the lecture notes.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
String
An array of characters terminated by a special character '\0' (null character).
Null character '\0'
A special character that marks the end of a string in C.
char str[] = "computer";
Declares a character array 'str' and initializes it with the string 'computer'.
strlen() function
A function used to return the length of a string, counting the number of characters present.
strcat() function
A function used to concatenate two strings by appending the second string to the end of the first string.
strcmp() function
A function used to compare two strings in a case-sensitive manner.
strcpy() function
A function used to copy one string to another.
Accessing elements of an array
Elements are accessed using their index number, with the first element at index [0].
Two-dimensional array
An array that contains rows and columns, also known as a matrix.
%s format specifier
Used in printf to print a string.
clrscr() function
Clears the console screen in C programming.
getch() function
Reads a single character from the keyboard without echoing it to the screen.
gets() function
Reads a line of input from standard input into a character array.
Accessing a string character
Characters in a string can be accessed using an index inside square brackets.
Updating characters in a string
Characters can be updated by using their index in the string.
Character array
A data structure in C used to store a string, declared as an array of 'char' type.