zoukankan      html  css  js  c++  java
  • 看淡生死,不服就干(C语言指针)

    看淡生死,不服就干

    emmmmm

    其实今天蛮烦的 

    真心没有高中轻松了啊 

    也不知道自己立的flag还能不能实现  

    既然选择了就一定坚持下去啊

    下面还是放一段之前写的代码吧

    这个代码是C和C++的混合版本

    关于兼容性的问题里面有标注

    main 函数应该是被我吃了

    emmmmmm 好烦

    #include<iostream>
    #include<stdlib.h>
    #include<stdio.h>
    #include<math.h>
    #include<ctime>
    #include<cmath>
    #include<cstdlib>
    #include<cstdio>
    #include<iostream>
    #include<string.h>
    #include<cstring>
    #include<Windows.h>
    #include<string.h>
    using namespace std;
    
    void zz_first()  //数字应用指针
    {
        int * a, b=85;
        a = &b;
        cout << *a;
    }
    
    void zz_second()//一维数组的应用指针
    {
        int* c, d[10] = { 1,2,3,4,5,6,7,8,9,0 },e;
        c = d;
        //c = &d[0];  不同的写法
        for (e = 0; e < 10; e++)
        {
            cout << *(c + e)<<endl;
            Sleep(100);
        }
    }
    
    void zz_third()//二维数组的指针
    {
        int* f, g[2][3] = { 1,2,3,4,5,6 },h,i;
        f = g[0];
        //f = &g[0][0];
        for (h = 0; h < 6; h++)
        {
            cout << *f++;
        }
    }
    
    //void zz_thirdt() //二维数组的指针
    //{
    //    int i[2][3] = { 2,3,4,5,6,1 };
    //    int(*j)[3];
    //    int k, l;
    //    for (k = 0; k < 2; k++)
    //    {
    //        for (l = 0; l < 3; l++)
    //        {
    //            printf("%d", (*(j + k) + l));
    //        }
    //    }
    //}                  C++不兼容,去C实验
    
    void zz_fourth()//字符串复习
    {
        char a[10] = { "hello" };
        printf("%s", a);
    }
    
     int main()
    {
        zz_third();
        return 0;
    }
  • 相关阅读:
    IIS5布署MVC3
    操作数数据类型 ntext 对于 max 运算符无效
    iis配置
    IIS取消目录浏览
    mediamind SyncAds
    告诉你如何做网站运营
    xml as3解析
    mediamind 组件
    AIR for androd 笔记
    开发AIR for android 大象游戏合集开发总结
  • 原文地址:https://www.cnblogs.com/Loving-Q/p/11872179.html
Copyright © 2011-2022 走看看