1. #include <stdio.h>
    2. #include <iostream>
    3. #include <stdlib.h>
    4. using namespace std;
    5. int main() {
    6. //如果是整形,如何改变指针指向的值
    7. int a[2] = { 111,222 };
    8. int* p = a;
    9. int* p2;
    10. p2 = p;
    11. *p = 22;
    12. //如果是字符串型,如何改变指针指向的值
    13. const char* aa = "I love China!";
    14. const char* bb = "u love China!";
    15. int cc = (int)(bb - aa);
    16. const char* pp = (aa + cc);
    17. while (*pp)
    18. {
    19. putchar(*pp); //单字符输出
    20. pp++;
    21. }
    22. return 0;
    23. }