|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
/ f8 f1 g8 j$ M q7 F+ p- E来个实例,大家看看 _7 k0 e3 ^/ h$ U' ~
' S: y3 L; c( d' ~- R5 M
- T" N I) I4 J. g
+ f, d0 e5 y" H* R- int obj_num = 10;, }' K' i9 `5 I! `- l# h5 x2 K2 }
- tag_t *object = NULL;) F% n) H& ?( k
- object = (tag_t *) UF_allocate_memory( obj_num * sizeof(tag_t), &error );& u( w6 T% k2 `
- object = (tag_t *) UF_reallocate_memory( object, (obj_num+1) * sizeof(tag_t), &error );
{# L3 l3 D, f3 [ - UF_free( object );
7 `8 K- A* L% D2 }8 E8 \) r1 L/ d - char **strings = NULL;5 k% {3 a w$ x) G
- strings = (char **) UF_allocate_memory( 10 * sizeof(char *), &error );9 n% g& G* A; a
- for ( i = 0; i < 10; i ++ )
7 V1 X1 B1 u4 J$ ?" O - { strings[i] = NULL; 3 u+ c, J. P! J* Q8 t
- strings[i] = (char *) UF_allocate_memory( 133 * sizeof(char), &error );
9 z# F& \5 a) B! @ - }
8 q9 {" w' i6 s - UF_free_string_array( 10, strings );# o! W6 s! ~6 a
- double (*point_coords)[3];* s" ?, Y) j8 s5 i1 @6 d
- point_coords = (double (*)[3]) UF_allocate_memory( 10 * sizeof(double [3]), &error );
1 @9 o- F0 \ t8 S2 ^! e - Static void my_function ( int *num, tag_t **object ): P1 o# W7 r; ?5 ]
- { 8 Q2 W6 }$ G X! V; @- Q G
- (*num) = 10;' _: _# U3 ^( U+ I4 I# P
- (*object) = (tag_t *) UF_allocate_memory( (*num) * sizeof(tag_t), &error );
% x( |5 w2 Z% W3 z/ l* I - (*object)[0] = NULL_TAG;
! q& O0 B; V0 g: [4 } - }
: M6 g5 `) z- L8 @8 n y( j
复制代码 typedef struct UF_CURVE_line_s {
5 K/ `" Y4 s# [6 o double start_point[3];
7 I- P6 l2 F: F. [5 S C double end_point[3]; ) B+ s+ U( S! r
} UF_CURVE_line_t, * UF_CURVE_line_p_t; ! O- G) z! p8 d% p& w
* `: G' K% d$ G% e6 b2 C
UF_CURVE_line_t my_line; 3 d# s, g, b* W* O$ @% `, A/ U
my_line.start_point[0] = 0.0;. G( O5 T, g! U0 ^2 _; `1 M
9 ~' @" |& b2 _ UF_CURVE_line_t *my_line;
: s7 N5 w* I/ B8 Q& Z! \ my_line->start_point[0] = 0.0;
+ f, y! ~9 [( L+ U) }0 z. D. p) Z; y
UF_CURVE_line_p_t my_line;
2 B! m4 H" G, Y# z' p my_line->start_point[0] = 0.0;
" d6 @$ K- w$ ?# W% M6 P0 v4 ?1 j9 N# Y4 f* {; f, v7 B
' _0 O2 l3 H8 M2 M* c
|
|