
C++ Primer Plus学习笔记
文章平均质量分 54
xiaoyaoyao17
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
数组的替代品vector和array
#include #include //STL C++98#include //C++11int main(){ using namespace std; //C, original C++ double a1[4]={1.2,2.4,3.6,4.8}; //C++ 98 STL vector a2(4); //create vector wit原创 2017-03-28 10:19:20 · 751 阅读 · 0 评论 -
用clock()和ctime写一个延时循环
#include #include //describe clock() function, clock_t typeint main(){ using namespace std; cout<<"Enter the delay time, in seconds: "; float secs; cin>>secs; clock_t delay= s原创 2017-03-30 08:38:49 · 1392 阅读 · 0 评论 -
字符函数库cctype
#include #include int main(){ using namespace std; cout<<"Enter text for analysis, and type @" "to terminate input.\n"; char ch; int whitespace =0; int digits=0; i原创 2017-03-30 16:01:19 · 453 阅读 · 0 评论 -
使用new创建动态结构
#include struct inflatable //struck defination{ char name[20]; float volume; double price;};int main(){ using namespace std; inflatable* ps= new inflatable;//为结构体分配内存空间 co原创 2017-03-25 10:11:44 · 649 阅读 · 0 评论 -
4.18arraynew指针与数组名
#include int main(){ using namespace std; double* p3=new double [3]; p3[0]=0.2; p3[1]=0.5; p3[2]=0.8; cout<<"p3[1] is "<<p3[1]<<".\n"; p3=p3+1; cout<<"Now p3[0] is "原创 2017-03-16 16:01:23 · 440 阅读 · 0 评论 -
类型组合
#include struct antarctica_years_end{ int year;};int main(){ antarctica_years_end s01,s02,s03; s01.year=1998; antarctica_years_end* pa=&s02; pa->year=1999; antarctica_yea原创 2017-03-25 21:44:37 · 541 阅读 · 0 评论 -
C++文件的输出、输入
输出到文件#include #include using namespace std;int main(){ char automobile[50]; int year; double a_price; double d_price; ofstream outFile; outFile.open("carinfo.txt");原创 2017-03-31 10:22:06 · 461 阅读 · 0 评论