代码:
#include <vector>
#include <iostream>
typedef struct
{
std :: string latitude;
std :: string longitude;
} coordinate;
std :: vector <coordinate> previousPoints;
int main ()
{
coordinate.latitude = latitude;
coordinate.longitude = longitude;
previousPoints.push_back (coordinate);
return 0;
}
输出:
anisha@linux-y3pi:~> g++ -Wall demo.cpp
demo.cpp: In function ‘int main()’:
demo.cpp:14:12: error: expected unqualified-id before ‘.’ token
demo.cpp:15:12: error: expected unqualified-id before ‘.’ token
demo.cpp:16:38: error: expected primary-expression before ‘)’ token
我错过了什么?