Searching memory for an adress?
Ok! I made a very small program to search through my memory. But, it doesn't cut out when it finds its values. Now, what I thought this would do is end at variable adress c or d. Instead, it never ends.
Code:
#include <iostream>
using namespace std;
int main() {
int *a;
int b;
int c = 9999;
int d = 0;
for(a = &b; a != &c || a != &d; a++) {
cout << a;
}
}
Being set to the adress of b shoulden't it cut out directly after a++? Or is memory not set up that way? Well, thank you in advance.