#ifndef _TYPE_H_ #define _TYPE_H_ #include <string> #include <map> #include <vector> #include <stdlib.h> //顏色 typedef struct Color { int r; int g; int b; }mColor; //位置 typedef struct point { float x; float y; }mPoint; //范圍 typedef struct area { float w; float h; }mArea; //BMFont typedef struct label { std::string content; std::string fontName; mColor color; mPoint point; mArea area; }mLabel, *pLabel; //數據 typedef struct dataStr { std::string content; std::string fontName; mColor color; int type; }sDataStr, *lpDataStr; typedef map<int, sDataStr> mapData; #endif
在 typedef map<int, sDataStr> mapData;
報錯 :error: expected initializer before '<' token
要加命名空間 using namespace std;
每天進步一點點。