G
gmelcer
Hi, I need to use the data type "struct" in a class. Could someone show
me a simple example of how to use stuct in a class and access the data
type which is declared in the private section of the class. Here is an
exmaple of what I am trying to do. If someone could quickly write a
module to acces the structure I would highly appreciate it
#include <iostream>
#ifndef POLYLINE
#define POLYLINE
struct PointSet{
float x;
float y;
};
typedef PointSet Point;
class PolyLine
{
public:
float length();
void insert(int x, int y, int placement);
void remove(int placement);
void store();
private:
int counter;
Point Points[50];
};
#endif
..
me a simple example of how to use stuct in a class and access the data
type which is declared in the private section of the class. Here is an
exmaple of what I am trying to do. If someone could quickly write a
module to acces the structure I would highly appreciate it
#include <iostream>
#ifndef POLYLINE
#define POLYLINE
struct PointSet{
float x;
float y;
};
typedef PointSet Point;
class PolyLine
{
public:
float length();
void insert(int x, int y, int placement);
void remove(int placement);
void store();
private:
int counter;
Point Points[50];
};
#endif
..