![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++学习笔记
文章平均质量分 62
houchuanhao
内蒙古大学2014级本科生 专业: 电子商务
展开
-
C++动态存储的应用
数组名是常量指针,不允许进行修改。 例如 char a[20]; char b[20]; cin>>a; //b=a; 错误,无法这样赋值,因为b是一个常量指针,也就是说b是一个无法修改的地址; 但是,运用动态存储可以解决这个问题。 char * a; a= new char[20]; //动态分配长度为20的字符型数组; cin>>a; b= new char[20];原创 2015-04-20 20:49:31 · 388 阅读 · 0 评论 -
C++链表插入节点
#include using namespace std; struct node { int data; node * next; }; int main() { node *head,*p,*q,*s; head=p=q=s=NULL; int i,j,k,n; cin>>n; q=new node; for (i=1;i { s=new node; cin>>s-原创 2015-04-21 17:41:04 · 3035 阅读 · 0 评论 -
C++获取系统时间
#include #include using namespace std; void main() { tm *year; //年 tm *month; //月 tm *day; //日 tm *hour; //时 tm *minute; tm *second; time_t t; t = time(0); year = localtime(&t原创 2015-09-08 10:40:47 · 260 阅读 · 0 评论