7.6

#include  
#include  
using namespace std;  
typedef struct student 
{int num; 
 char name[20]; 
 double score; 
}; 
int main() 
{
 student stud[3]={1001,"Li",78,1002,"Wang",89.5,1004,"Fun",90}, dstud1[3];
 student stud1[3];
 char c[50]; 
 int i; 
 ostrstream strout(c,50); 
 for(i=0;i<3;i++) 
 strout<>stud1[i].num>>stud1[i].name>>stud1[i].score; 
 cout<<"data from array c to array stud1:"<
7.6_第1张图片

你可能感兴趣的:(第七章输入输出流)