What is an array in C?, A collection of elements of the same data type stored in contiguous memory locations., How do you declare a single dimensional array?, int arr[5];, What is the index of the first element in an array?, 0, What is the index of the last element in an array of size n?, n – 1, How do you initialize an array during declaration?, int arr[5] = {1,2,3,4,5};, What happens if fewer elements are given during initialization?, Remaining elements are initialized to 0 or garbage value, What is unsized array initialization, Array size is not specified, compiler determines size automatically. int arr[] = {10,20,30};, Is unsized array allowed without initialization?, No, Can unsized arrays be used with strings?, Yes. char str[] = "Hello";, What is a two-dimensional array?, An array of arrays used to store data in rows and columns., Syntax for declaring a 2D array?, int arr[3][4];, How many elements are there in int arr[3][4];?, 12, How are elements accessed in a 2D array?, Using row and column index. arr[1][2], Give an example of 2D array initialization., int arr[2][3] = { {1,2,3}, {4,5,6}};, Which loops are usually used to traverse a 2D array?, Nested loops, What is a multidimensional array?, An array having more than two dimensions., How many elements are there in int arr[2][3][4];, 24, Which loops are required to traverse a 3D array?, Three nested loops, What is a string in C?, A string is a character array terminated by '\0'., How do you declare a string?, char str[20];, How do you initialize a string?, char str[] = "Hello";, Which function reads a string with spaces?, fgets(), Which function finds the length of a string?, strlen(), Which function copies one string to another?, strcpy(), Which function compares two strings?, strcmp(), What is an array of strings?, A collection of multiple strings stored in a 2D character array., What is an Array of Character Pointers?, An array of character pointers is an array where each element is a pointer that points to the first character of a string., How many strings can char name[4][10]; store?, 4 strings, What is the maximum length of each string in char name[4][10];?, 9 characters + \0, Which format specifier is used to print a string?, %s, Which header file is required for string functions?, string.h, What happens if \0 is missing in a string?, String functions may read garbage values., Are strings stored continuously in array of character pointers?, No., Are strings stored continuously in a 2D character array?, Yes., Give one advantage of array of character pointers., Strings can have variable length..
0%
C Programming Module 2
共用
共用
共用
由
Kaccse
編輯內容
列印
嵌入
更多
作業
排行榜
顯示更多
顯示更少
此排行榜當前是私有的。單擊
共用
使其公開。
資源擁有者已禁用此排行榜。
此排行榜被禁用,因為您的選項與資源擁有者不同。
還原選項
快閃記憶體卡
是一個開放式範本。它不會為排行榜生成分數。
需要登錄
視覺風格
字體
需要訂閱
選項
切換範本
顯示所有
播放活動時將顯示更多格式。
)
打開結果
複製連結
QR 代碼
刪除
恢復自動保存:
?