Monday, May 18, 2009

c++ pointer and array

It took me a few days to fix the program to get the real time coordinates of a draganflyer from
Vicon 8i System.

My program is written in c++ with the application of Vicon Real Time SDK.

1, set up 6 vicon cameras and calibrated these cameras so that you can check the draganflyer with 5 markers on it in Vicon IQ, in IQ, create rigid body with 5 markers, the rigid body is named as draganflyer, the workstation IP address (192.168.1.230), the datastation IP address (192.168.1.117).

2, download Vicon Real Time SDK.

3, in Visual c++, create your own project, include VrtSDK10ex.h header files in your folder.
link with VrtSDK10ex.lib ( in Visual c++, Project--->Add Existing Item---> choose VrtSDK10ex.lib in your folder).

4, begin to write your own program,

char address1="192.168.1.230";
char *chIpAddress=address1;

int BodyCount=0; //zero based, the first body number is 0
int *p_BodyCount=&BodyCount; // for it has to have "&"

int my[3]={1,2,3};
int *ptr=my; //it means it get my[0];

char chBName[50]={};
char *p_chBName=chBName;

Pay attention to the difference of pointers usage in int, array. It took me a few days to figure it out. I am quite new to c++.

No comments: