I'm implementing a new method of data input for my program using the
push_back(int) function.
When I compile my code (Borland free compiler), I get:
"Could not find a match for 'vector<facetinfo, allocator<facetinfo>
::push_back(int)' in function main()"
Am I missing something?
TIA
#include <stdlib>
#include <math>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
using std::cout;
using std::cin;
using std::ifstream;
using std::string;
using namespace std; //I don't need the previous lines, right?
struct facetInfo {
double v1x;
double v1y;
double v1z;
double v2x;
double v2y;
double v2z;
double v3x;
double v3y;
double v3z;
double nox;
double noy;
double noz;
}; // Semicolon necessary
int main()
{
char fileName[255];
cout << "Enter the name of the input *.STL file (including extension): ";
cin >> fileName;
ifstream inf(fileName);
cout << fileName;
char buffer[128];
char * ehWhy;
int vertNum=1;
int facetNum=0;
int normFlag=0;
int vertFlag=0;
int compFlag=0;
double holder;
string ncheck = "normal";
string vcheck = "vertex";
// 10234 facets
vector<facetInfo> mySurface;
while(!inf.getline(buffer, 128, ' ').eof())
{
if (buffer == ncheck)
{
normFlag=1;
compFlag=1;
vertNum=1;
if (facetNum !=0)
{
mySurface.push_back(facetNum);
}
...... etc
}
}
Alex
--
Reply to:alex an.ti livingstone sp@am btinternet.com cutting the usual...