我们都知道IPv4的地址localhost是127.0.0.1(环回地址).什么是IPv6地址localhost和0.0.0.0我需要阻止一些广告主机.
这是第一个名为hooktry.cpp的程序
#include <iostream>
#include<stdio.h>
using namespace std;
class c1{
int c=2;
public:
int * printadd()
{
int *p=&c;
printf("the address of c is %d\n",p);
return p;
}
void printv()
{
printf("the value is ===%d\n",c);
}
};
int main(int argc, const char * argv[]) {
int *p;
c1 mem;
char c;
p=mem.printadd();
mem.printv();
*p=12;
scanf("%c",&c);
mem.printv();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
输出:c的地址是1606416304
,值是=== 2
同时运行另一个代码hooktry2.cpp
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
// insert code here...
int …Run Code Online (Sandbox Code Playgroud)