The size of a pointer in C is not fixed because it relies on the processor's Word size
What is sizeof pointer in C++?
- In C/C++, a pointer's size is not constant. It relies on a variety of factors, including the operating system and CPU architecture. Typically, it relies on the word size of the underlying processor. For instance, a pointer size for a 32-bit computer may be 4 bytes, whereas a pointer size for a 64-bit machine could be 8 bytes.
- The size of a pointer in C is not fixed because it relies on the processor's Word size. The size of a pointer would typically be 4 bytes for a 32-bit computer system and 8 bytes for a 64-bit one.
#include <iostream>
using namespace std;
int main() {
int size1;
int size2;
int* sizePointer;
cin >> size1;
cin >> size2;
/* Your code goes here */
if (sizePointer == nullptr) {
cout << "The sizes are the same." << endl;
}
else {
cout << *sizePointer << " is the smaller size." << endl;
}
return 0;
}
To learn more about pointer refer,
https://brainly.com/question/22212364
#SPJ4