Which of the following will correctly compare two strings?
What is the correct syntax to concatenate two strings safely in modern C?
What does the following code do?
char str[] = "HELLO";
for(int i = 0; str[i]; i++) str[i] = str[i] + 32;
Consider: char str[10]; strcpy(str, "Hello"); What is the state of memory after this?
What does strtok(str, delim) return on each call until the string ends?
Advertisement
What is the correct way to declare a pointer to a character array?
What happens when you try to modify a string literal in C?
char *str = "Hello";
str[0] = 'J';
Which of the following correctly reverses a string in-place?
What is the output of the following code?
char str[] = "GATE";
printf("%d", sizeof(str));
Consider: int arr[10]; int *ptr = arr; What does ptr[5] represent?
What will be printed?
char str[] = "Hello";
printf("%c", *(str+2));
What is the difference between arr[5] and *arr when arr is an array?
Which statement about 2D arrays in C is correct?
What is the output?
char str[6] = {'H','e','l','l','o'};
printf("%s", str);
Consider a 3D array: int arr[2][3][4]. How many elements total?
What will be the result of accessing arr[10] when arr is declared as int arr[5]?
What is the difference between char str[20] and char *str in C?
What does strcpy(dest, src) do, and what is its main risk?
In a string comparison, strcmp('Apple', 'apple') returns:
What is the memory layout of a 2D array int arr[3][4] in C?