20116.10.26 引用和指针

来源:互联网 发布:powershell for linux 编辑:程序博客网 时间:2024/06/13 01:45
张凌枫<2016.10.25> 【连续第3天总结】

A.今日任务
 1.循环结构复习(90%)
 2.指针和引用(90%)
 3.const关键字(70%)

B.具体任务
 1.搞了个金字塔觉得很好玩
 2.指针的引用和引用的指针 指针的指针和引用的引用感觉有点像绕口令不过实际用起来感觉还不错
 3.const关键字到现在还没有找到用的地方
 4.分号!!分号!!

附代码:
 #include <iostream>
 //#include <stdlib.h>
 using namespace std;
 
void jinzita(int x)
{
 for(int i = 1 ; i<=x;i++)
  {
   for(int k = x-i ;k>0;k-- )
   {
    cout<<" ";
   }
   for (int y = 0 ; y<2*i-1 ;y++)
   {
    cout<<"*";
   }
 cout<<endl;
 }
 }
 
 int main()
 {
  jinzita(60);
 system("pause");
 return 0;
 }





#include <iostream>
using namespace std;

int main()
{
 int a;//张三
 int &b = a;//小张
 int *c = &b;//第?排
 *c = 1;//小张在第一排
 cout<<a<<endl;张三在第一排

 system("pause")
 return 0
}



明日任务
 1.复习之前所学
 2.函数的特性
 3.内存管理

博客地址:http://blog.csdn.net/night__day/article/details/52905196
0 0
原创粉丝点击