I have made an initial foray into using vectors in windows forms. After studying several sites on vectors I created a new windows form (VS2010).
I wrote the class code using managed strings and called it public ref class raw_mat.
The declaration line was vector <raw_mat> allRawMaterials; When compiled the error messages are:
Error 1 error C2143: syntax error : missing ';' before '<'
Error 3 error C2238: unexpected token(s) preceding ';'
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
If I comment out the vector <raw_mat> allRawMaterials; line the program compiles and runs.
What am I missing?
Following is the code for the class and Form1.
class code: // more data members and code to follow if this can be made 2 work
// should I even be using managed strings here?
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
public ref class Form1 : public System::Windows::Forms::Form
{
public:
vector <raw_mat> allRawMaterials;
Form1(void)
{
InitializeComponent();
}