Have a try: istrstream shapefile(data); // you must #include The istream not constructor like that istream(char* ...) I think that you need istrstream
mylzw
Posts
-
ifstream question -
ifstream question#include #include using namespace std; void main() { ifstream in("c:/boot.ini"); in.seekg(0, ios::end); //set file-stream pos at end streampos ps = in.tellg(); //get the pos cout << "File size: " << ps << endl; //file size by "byte" in.close(); //close... }
-
operator overloading questionhomework ??? add these code in the class point... class point { //old code..... // // my add constructor... int. point(int single) { _x=single; _y=single; } // overloaded operator methods .... friend point operator +(const point& p1,const point& p2) { return point(p1._x+p2._x , p1._y+p2._y); } friend point operator -(const point& p1,const point& p2) { return point(p1._x-p2._x , p1._y-p2._y); } friend point operator *(const point& p1,const point& p2) { return point(p1._x+p2._x , p1._y*p2._y); } friend point operator /(const point& p1,const point& p2) { if (p2._x==0 || p2._y==0) return point(0 , 0); else return point(p1._x/p2._x , p1._y/p2._y); } //~.. }; //then you can using like.... p3=p1+p2; p3=p1-p2; p3=p1*p2; p3=p1+1; p3=p1/100; p3=p1/0; .......... ......