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 代码
删除
恢复自动保存:
?