#include <stdio.h>

void main()


int a1=10;
int a2=11;
int * pa1, * pa2;
pa1 = &a1;
pa2 = &a2;

printf("a1=%d \pa1:%p\n",a1,pa1);
printf("a2=%d \pa2:%p\n",a2,pa2);


printf(" After the assignment \n");

printf("a1=%d\ pa1:%p\n",a1, pa1);
printf("a2=%d\ pa2:%p\n",a2, pa2);

//*pa1=*pa2 and a1=a2 Same operation


pa2=pa1;// hold pa1 The pointer address of is copied to pa2
printf("a1=%d\ pa1:%p\n",a1, pa1);
printf("a2=%d\ pa2:%p\n",a2, pa2);
// Pointer address copy , hold pa1 The pointer address of is copied to pa2 After now, the pointer pa1 and pa2 All point to variables a1

return 0;

c More articles about pointer learning

  1. [ turn ]C Summary of language learning experience

    Pointer is C The difficulty and emphasis of language , But the pointer is also C The soul of language . This article C The summary of language learning experience is mainly my learning since I started my career C Bit by bit recording in the process of pointer . There is no repetition in the document of the conceptual things clearly stated in the book , Just compare some that are not clear or understood ...

  2. Qt Smart pointer learning (7 Kind of pointer )

    Qt Smart pointer learning Reprinted from :http://blog.csdn.net/dbzhang800/article/details/6403285 Start with a memory leak ? A very simple entry program , Should be familiar with it ^_^ ...

  3. C++ Smart pointer in 、 Lightweight pointer 、 Strength indicator study notes

    One . Intelligent pointer learning summary 1. A non const Reference cannot point to a temporary variable , however const It's OK to quote ! 2.C++ Medium delete and C Medium free() similar ,delete NULL Not to report "doubl ...

  4. c Summary of pointer learning ( Learn from others' experience )

    Pointer learning and summary I .1.int *p :p And * First combine , explain p It's a pointer , Then with int The combined description points to a int Type .2.int p[3] :p And [] Combined description p Is an array , Then with int combination , Explain the elements in an array ...

  5. 《 Challenge 30 God C++ Entry limit 》c++ Two excellent examples of pointer learning in

        c/c++ Two excellent examples of pointer learning in For the questions raised by many people c/c++ Make a summary of the problems that are difficult to learn : The key to poor pointer learning is unclear concept , To put it simply, I didn't read the book carefully , The study of the pointer is just like the study of the human being ...

  6. C Language learning

    C Linguistics has been a long time , There is no clear understanding of the pointer , Take advantage of the opportunity to study hard , Sum up what you have learned , Knowledge comes from C A detailed explanation of language pointer One : The concept of pointer A pointer is a special variable , The value stored in it is an address in memory . ...

  7. Android Smart pointer learning One

    Android5.1 The files involved in the smart pointer in are as follows : system/core/include/utils/RefBase.h system/core/libutils/RefBase.cpp system ...

  8. C++ Study - Virtual table , Virtual functions , Virtual function table pointer learning notes

    http://blog.csdn.net/alps1992/article/details/45052403 Virtual functions Virtual function is to use virtual To modify a function . A virtual function is an implementation C++ The basis of polymorphism . Virtual table Every ...

  9. 1.C Plug in of language learning

    To study the c The pointer to language , So what can a pointer do , First , He can write plug-ins First, let's write a dll, Mount to plants vs Zombies , Remember it's dll, Because if you create an application , This application can't operate the address of other programs . First step , hit ...

  10. C Summary of language learning

    Study at school C Language , The most annoying thing is the pointer inside , But the pointer is exactly the same C The soul of language . Recently, we are reviewing the content of data structure , Because most of the data structure textbooks are based on C In words , The data structure also uses a lot of pointer content , So I'm in this note ...

Random recommendation

  1. ArcEngine Batch addition XY data

    Use ArcGIS Desktop “ add to XY data ” perhaps “ establish XY Event layer ” Tools You can import Excel Coordinate data , Generate temporary layers and add them to ArcMap.ArcGlobe perhaps ArcScene in . stay ArcEngin ...

  2. spring mvc ajax Submit complex array type

    The server refused this request because the request entity is in a format not supported by the reque ...

  3. python IO Document processing

    python The file read and write operators are :r w a r+ w+ rb wb Except for file To open a file , Another way is to open 了 , The two usage is as like as two peas. , Can be seen as open Namely file Another name for The table below is ...

  4. Violence enumeration UVA 10976 Fractions Again?!

    Subject portal /* x>=y, 1/x <= 1/y, therefore 1/k - 1/y <= 1/y, namely y <= 2*k */ #include <cstdio> #inc ...

  5. Data Flow -&gt;&gt; CDC Control Task, CDC Source, CDC Splitter

    CDC Control Task Can be controlled from CDC Data synchronization , For example, initial loading .LSN Scope management . It can take the place of another approach , By calling a batch of CDC Function to do the same thing . from SSIS It's done from a different angle , It's easy to program , And others ...

  6. C# How to get the parent directory of the current application

    // Get the superior directory of the current running path ( Parent directory ) System.IO.DirectoryInfo topDir = System.IO.Directory.GetParent(System.Environme ...

  7. Do it yourself series —— Implement a simple one ArrayList

    ArrayList yes Java A classic implementation class in collection framework . It's better than the usual array , The obvious advantage is that , You can add and delete elements at will, regardless of the size of the array . For the purpose of training , Implement a simple one ArrayList, And put it into practice ...

  8. mysql Splicing

    SELECT  RTRIM(CONCAT(belong_master_ip ,'(',host_name,')')) AS cloudIP  FROM `cloud_master_cfg`

  9. everyday PA -2019 year 1 SkyDX - Update daily

    The opening " everyday PA" What are the highlights ?

  10. selenium+python automation 78-autoit Parameterization and batch upload

    Preface The previous autoit Achieve file upload package into .exe After the executable , Only the fixed picture can be sent each time , We want to send different pictures in the actual test . So every time you call , Just add a file path parameter to the command line . One . Command line arguments ...