您的位置 电脑知识爱好者 >> 编程知识 >> 数据库oracle在C++程序中使用方法

数据库oracle在C++程序中使用方法

电脑知识爱好者互联网电脑知识爱好者2008-5-1 5:40:15
知识重点:数据库oracle在C++程序中使用方法堆栈是最常用的数据结构。它的概念简单,编写也比较简单。有这么一个情况,桌子上有堆成一堆的5本书,你想增加一本。应该怎么做?只要把书放在顶端就可以了。如果..
 top--;
  }
  }
  int pop() // Delete Item. Returns the deleted item
  {
  if(top==-1)
  {
  cout<<"STACK IS EMPTY!!!"< 
  return NULL;
  }
  else
  {
  int data=arr[top]; //Set Topmost Value in data
  arr[top]=NULL; //Set Original Location to NULL
  top--; // Decrement top by 1
  return data; // Return deleted item
  }
  }
  };
  int main()
  {
  stack a;
  a.push(3);
  cout<<"3 is Pushed\n";
  a.push(10);
  cout<<"10 is Pushed\n";
  a.push(1);
  cout<<"1 is Pushed\n\n";
  cout< 
  cout< 
  cout< 
  return 0;
  }


  输出为:

 

参与评论
相关内容
关于我们 | 隐私政策 | 站点地图 | 站长博客|京ICP备07025396号
添加到百度搜藏 添加到百度搜藏 电脑知识爱好者Copyright ?2006-2008版权所有 我要啦免费统计