UG NX二次开发中大量指针的使用技巧
来个实例,大家看看
int obj_num = 10;
tag_t *object = NULL;
object = (tag_t *) UF_allocate_memory( obj_num * sizeof(tag_t), &error );
object = (tag_t *) UF_reallocate_memory( object, (obj_num+1) * sizeof(tag_t), &error );
UF_free( object );
char **strings = NULL;
strings = (char **) UF_allocate_memory( 10 * sizeof(char *), &error );
for ( i = 0; i < 10; i ++ )
{ strings = NULL;
strings = (char *) UF_allocate_memory( 133 * sizeof(char), &error );
}
UF_free_string_array( 10, strings );
double (*point_coords);
point_coords = (double (*)) UF_allocate_memory( 10 * sizeof(double ), &error );
Static void my_function ( int *num, tag_t **object )
{
(*num) = 10;
(*object) = (tag_t *) UF_allocate_memory( (*num) * sizeof(tag_t), &error );
(*object) = NULL_TAG;
}
typedef struct UF_CURVE_line_s {
double start_point;
double end_point;
} UF_CURVE_line_t, * UF_CURVE_line_p_t;
UF_CURVE_line_t my_line;
my_line.start_point = 0.0;
UF_CURVE_line_t *my_line;
my_line->start_point = 0.0;
UF_CURVE_line_p_t my_line;
my_line->start_point = 0.0;
老大 能否给点文字说明 给你我们这些入门级别的人提供点参考
页:
[1]