字符串流问题
程序代码:
#warning This file includes at least one deprecated or antiquated header. \ Please consider using one of the 32 headers found in section 17.4.1.2 of the \ C++ standard. Examples include substituting the <X> header for the <X.h> \ header for C++ includes, or <iostream> instead of the deprecated header \//这是错误提示里面点开后的提示,什么意思啊? #include<iostream> #include<strstream>//这个头文件哪里错了? #include<conio.h> using namespace std; int main() { char c[50]="12 34 65 -23 -32 33 61 99 321 32";//这里是"1"一个字节,"2"一个字节吗?这样就是一个整形变量2个字节 int a[10],i,j,t; cout<<"array c:"<<c<<endl; istrstream strin(c,sizeof(c));//缓冲区大小是50 for(i=0;i<10;i++)//系统怎么知道是10个整数,没有指定大小啊? strin>>a[i];//这里怎么给数组a 10个整数?这个for循环里strin是把c中的10个字符(还是整数)给a cout<<"array a:"<<endl; for(i=0;i<10;i++) cout<<a[i]<<" "; cout<<endl; for(i=0;i<9;i++) for(j=1;j<9-i;j++) if(a[i]>a[j]) {t=a[i];a[i]=a[j];a[j]=t;} ostrstream strout(c,sizeof(c)); for(i=0;i<10;i++) strout<<a[i]<<" "; strout<<ends; cout<<"array c:"<<c<<endl; getch(); return 0; }