M
Michael
Hello,
How can pointers be used in VB?
Here is an example in 'C'
How can the same be done in VB?
(I am using MS Access 2000)
Thanks,
Michael
Code: -------------------------------------
typedef far struct point {
float x;
float y;
float z;
float d;
struct point far *nextX;
struct point far *nextY;
} far Point;
void main(void)
{
float a,b,c;
Point far *p2D;
/*... code ...*/
CalculPts(a,b,c,&p2D);
} /* main */
void CalculPts(float aa, float bb, float cc, Point far
**pt2D)
{
Point far *currentX,far *currentY;
*pt2D = (Point far *) farmalloc(sizeof(Point));
currentX = *pt2D;
currentY = *pt2D;
currentX->x = aa;
currentX->y = bb;
currentX->z = cc;
currentX->d = 1;
/*... code ...*/
currentX->nextX=NULL;
currentX->nextY = currentY;
/*... code ...*/
if (currentX->nextX!=NULL) currentX = currentX->nextX;
/*... code ...*/
currentY->nextY = (Point far *) farmalloc(sizeof
(Point));
if (currentY!=NULL) currentY = currentY->nextY;
} /* CalculPts */
How can pointers be used in VB?
Here is an example in 'C'
How can the same be done in VB?
(I am using MS Access 2000)
Thanks,
Michael
Code: -------------------------------------
typedef far struct point {
float x;
float y;
float z;
float d;
struct point far *nextX;
struct point far *nextY;
} far Point;
void main(void)
{
float a,b,c;
Point far *p2D;
/*... code ...*/
CalculPts(a,b,c,&p2D);
} /* main */
void CalculPts(float aa, float bb, float cc, Point far
**pt2D)
{
Point far *currentX,far *currentY;
*pt2D = (Point far *) farmalloc(sizeof(Point));
currentX = *pt2D;
currentY = *pt2D;
currentX->x = aa;
currentX->y = bb;
currentX->z = cc;
currentX->d = 1;
/*... code ...*/
currentX->nextX=NULL;
currentX->nextY = currentY;
/*... code ...*/
if (currentX->nextX!=NULL) currentX = currentX->nextX;
/*... code ...*/
currentY->nextY = (Point far *) farmalloc(sizeof
(Point));
if (currentY!=NULL) currentY = currentY->nextY;
} /* CalculPts */