随笔分类 -  C++

摘要:#include <string.h>#include <vector>#include <algorithm>#include <string>#include <iostream>using namespace std;void main(){ string m("----------asdfas--------------dfgdf---------"); string::iterator it; vector<char> csr; vector<char>::iterator cit 阅读全文
posted @ 2012-02-09 01:03 Dsp Tian 阅读(699) 评论(0) 推荐(0)
摘要:#include <iostream>#include <string>#include <fstream>#include <iomanip>using namespace std;int main(){ ofstream fs("123.txt",ios::app); fs<<setw(7)<<"234234"<<setw(3)<<"12"<<endl; system("pause"); return 0 阅读全文
posted @ 2012-02-01 17:24 Dsp Tian 阅读(544) 评论(0) 推荐(0)
摘要:#include <iostream>#include <string>using namespace std;int main(){ string a,b; a="Dsp"; b="Tian"; char temp[5]; string ab; for(int i=0;i<13;i++) { sprintf(temp,"%d",i); ab=temp; cout<<a+ab+b<<endl; } system("pause"); return 0;} 阅读全文
posted @ 2012-01-30 16:47 Dsp Tian 阅读(686) 评论(0) 推荐(0)
摘要:#include <stdio.h>typedef void (* FP)(unsigned int a,unsigned int b);//void DataDeal(FP PCB);//void PointerReceive(unsigned int a,unsigned int b);//void Pointer(unsigned int a,unsigned int b);////////////////////////////////////////////////////////////////void Pointer(unsigned int a,unsigned i 阅读全文
posted @ 2012-01-15 00:22 Dsp Tian 阅读(604) 评论(0) 推荐(0)
摘要:#include <iostream>using namespace std;void malo(double **p){ *p =new double; double *w=new double[10]; for (int i=0;i<10;i++) { w[i]=2*i; } *p=w;}void main(){ double *m=NULL; malo(&m); for (int i=0;i<10;i++) { cout<<m[i]<<""; } delete[] m; syst... 阅读全文
posted @ 2011-12-04 14:34 Dsp Tian 阅读(1485) 评论(0) 推荐(0)