In C, if a pointer `ptr` points to an integer at memory address 1000, what happens when `ptr` is incremented by 1?
MCQ Subject: Programming in C & Pointers
-
Given ‘int *ptr’ pointing to the first element of an array on…
Given ‘int *ptr’ pointing to the first element of an array on a 32-bit system, what happens when ‘ptr’ is incremented by 1?
-
If ‘ptr’ is a pointer to an integer and ptr = &arr[0]…
If ‘ptr’ is a pointer to an integer and ptr = &arr[0] where arr is an integer array, what does ‘++ptr’ do?
-
Consider two pointers, ptr_int (pointing to int) and ptr_char (pointing to char),…
Consider two pointers, ptr_int (pointing to int) and ptr_char (pointing to char), both initially at memory address 1000. After executing ++ptr_int and ++ptr_char, their new addresses (assuming int=4 bytes, char=1 byte) will be:
-
In C, if a pointer p points to an integer (4 bytes),…
In C, if a pointer p points to an integer (4 bytes), what does (p + 1) point to?