[c/c++]数组名和指针的区别

/ 10评论 / 562阅读 / 0点赞
#include <iostream>
using namespace std;

int main()
{
	int i = 0;
	int* i_p = &i;
	int arr[10] = {};

	cout << "&i:   " << &i   << endl;
	cout << "i_p:  " << i_p  << endl;
	cout << "&i_p: " << &i_p << endl;
	cout << "arr:  " << arr  << endl;
	cout << "&arr: " << &arr << endl;
	cout << "sizeof(int):  " << sizeof(int) << endl;
	cout << "sizeof(int*): " << sizeof(int*) << endl;
	cout << "sizeof(i_p):  " << sizeof(i_p) << endl;
	cout << "sizeof(arr):  " << sizeof(arr) << endl;
	return 0;
}
  1. escanty说道:

    Gheith OA, Sobh MA, Mohamed Kel S, El Baz MA, El Husseini F, Gazarin SS, Ahmed HA, Rasem MW, Amer GM Impact of treatment of dyslipidemia on renal function, fat deposits and scarring in patients with persistent nephrotic syndrome viagra and cialis online Current approach to fibrous dysplasia of bone and McCune Albright syndrome

  2. Assumpmok说道:

    MacKman, Nigel Date of publication 2012 Abstract Chronic ОІ adrenergic receptor ОІ AR overstimulation, a hallmark of heart failure, is associated with increased cardiac expression of matrix metalloproteinases MMPs where to buy cialis

  3. embeway说道:

    over the counter viagra substitute walmart Dr Meyer explained to me only one embryo transfer will be done as I am a high risk already due to age and high blood pressure

  4. THATHECOM说道:

    buy cialis on line Monitor Closely 1 fosphenytoin will decrease the level or effect of alprazolam by affecting hepatic intestinal enzyme CYP3A4 metabolism

  5. Coikemn说道:

    The clinical outcome after antibiotic treatment is fairly good 3, 4 buy cialis uk Brownstein shared in his book

  6. grenuenah说道:

    Representative transmission electron micrographs of C57 J and Cngb1 neo neo K retinal sections how much does cialis cost Zhang HL, et al

  7. […] 首先从上面的例子的运行结果可见,结构体 CoolArr_s 的大小就是 int len 的大小。也就是说,柔性数组 char arr[] 并不会占一个指针的大小。数组名 arr 是一个常量地址,这个地址是紧接着 int len 的后面的地址。(数组名和指针是不同的) […]

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注