新手求教 用的vs一直提示表达式必须包含类类型 也不知道是啥意思
程序代码:
// ConsoleApplication18.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include"iostream" #include<algorithm> #include<iterator> using namespace std; struct stu { char name[20]; int number; }student[4] = { "sally",123456,"mark",354567,"ben",354699,"coco",122213 }; struct stu { char name[20]; int number; }st[4]; int main() { for each(st[4], student[4]); { st[4] == student[4]; cout << "st[4]" << endl; } vector<int> st; st.resize(4); copy(student, student + 4, st.begin()); cout << "stud contains:"<<endl; ostream_iterator<int> osint(cout, "-"); copy(st.begin(), st.end(), osint); cout << endl; system("pause"); return 0; }