1
0
forked from newde/homework
Files
homework/0307指针
2026-03-06 22:14:24 -05:00

21 lines
539 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
1 #include<iostream>
2 using namespace std;
3
4 int main(){
5
6 int a=10;
7 int b[5]={10,20,30,40,50};
8 int * prt_a , * prt_b;
9
10 prt_a=&a;
11 prt_b=b;
12 cout << "我是内存地址: "<<prt_a <<" 我是地址内的值 "<< * prt_a<<endl;
13 cout << "我是内存地址: "<<prt_b <<" 我是地址内的值 "<< * prt_b<<endl;
14
15 for (int i=0;i<5;i++)
16 cout << "我的地址:"<< prt_b+i<<endl;
17
18 return 0;//这个可以省略
19
20 }