---
title: "指针常量,常量指针"
author: "liu5320102"
date: "2010-06-09T21:51:21Z"
tags: ["J#"]
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2010-06-09T21:51:21Z"
id: 688374
url: "https://liu5320102.iteye.com/blog/688374"
---

	指针的指向可以变,但是不能通过指针修改数据!
//常量指针－－指向字符串常量，所指向的字符串内容不能变，但是指向的地址可以变化      
         int i=2;
	int j=12;
	int const * pi;
	pi=&i;

	pi=&j;

	printf("%d\n pi real=0x%d\n",*pi,pi);
	//指针常量－－指针本身是常量，指向的地址不可以变化,但是指向的地址所对应的内容可以变化


	int i=2,j=12;
	int * const pi=&i;
	*pi=22;