首頁  >  文章  >  資料庫  >  间接修改指针的地址技巧

间接修改指针的地址技巧

WBOY
WBOY原創
2016-06-07 14:59:50935瀏覽

// test for a pointer.cpp : Defines the entry point for the console application. // #include \"stdafx.h\" #include iostream using namespace std; typedef struct { int *p; }Test; int main( ) { int *p; // p[0] = 4; // p[1] = 3; Test test; p =

 // test for a pointer.cpp : Defines the entry point for the console application.
//
#include \"stdafx.h\"
#include
using namespace std;
typedef struct
{
 int *p;
}Test;
int main( )
{
 int *p;
//      p[0] = 4;
// p[1] = 3;

 Test test;

 p = (int *)&test;

 p[0] = 1;
 cout  cout  return 0;
}

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn