码迷,mamicode.com
首页 > 其他好文 > 详细

缓冲区的应用

时间:2014-09-26 22:53:58      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   ar   for   sp   div   c   

#include<stdio.h>
char A[10];
void inputElem(char &e){
    
    scanf("%c",&e);
}
bool endValue(char &e){
    if(e!=#)
        return false;
    else
        return true;
}
void createBST(){
    char e;int i=0;
    printf("输入关键字值序列\n");
    inputElem(e);//inputElem为表中元素输入函数
    while(!endValue(e)){//当e不是结束标识值时,endValue为结束标示值得判定函数
        A[i++]=e;
      inputElem(e);
    }
}
void main()
{ createBST();
  for(int i=0;i<10;i++)
      printf("%c ",A[i]);
}

 

缓冲区的应用

标签:style   blog   color   io   ar   for   sp   div   c   

原文地址:http://www.cnblogs.com/leijiangtao/p/3995475.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!