Consider a 2D array int matrix[3][3]. If we access matrix as a 1D array, how many total elements can we access?
What will be output of the following code?
char str[] = "GATE2025";
for(int i=0; str[i]!='\0'; i++)
if(i%2==0) printf("%c", str[i]);
Consider: int arr[3][4][5]. What is the size of arr[0][0]?
Which of the following is true about strcpy(dest, src)?
What is the main difference between char arr[] = "Test" and char *ptr = "Test"?
Advertisement
If ptr is a pointer to int array and ptr = arr, what does ptr[3] represent?
What is the correct way to safely copy strings in modern C?
In the declaration int *arr[10], what is arr?
In a dynamic 2D array created as: int arr = (int)malloc(rows * sizeof(int*)); What is the next step?
What will happen?
char arr[5] = "Hello";
printf("%d", strlen(arr));
What happens with this code?
char *ptr;
char str[] = "Programming";
ptr = str;
ptr[2] = 'X';
What will the following code print?
int arr[3] = {10, 20, 30};
int *p = arr;
printf("%d %d", *p++, *++p);
How should dynamic 1D array of strings be declared for 5 strings of length 20?
What is the most efficient way to copy one array to another in C?
What is the relationship between pointer arithmetic and array indexing in C?
What potential issue exists with this code: char *ptr = "Hello"; ptr[0] = 'h';?
For a 3D array int arr[2][3][4], what is arr[1][2][3] equivalent to?
In string handling, what is the difference between fgets() and gets()?
Which of the following correctly declares a pointer to an array (not array of pointers)?
In what scenario would you use memcpy() instead of strcpy()?