|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
3 G- e; k1 k* T3 f8 d
来个实例,大家看看. p1 h3 n. Z' R
/ n) U" G" r& ^2 m( M( K; a
6 C. b) `* a' l1 I
8 U8 p+ l' W+ F! b. w- [- int obj_num = 10;
4 g+ Y. {& R$ b7 P* O. T9 n8 m - tag_t *object = NULL;7 g% U/ T0 G/ }1 J# F) E' p
- object = (tag_t *) UF_allocate_memory( obj_num * sizeof(tag_t), &error );( O8 a. l" L, ]. R2 G* E" r# J
- object = (tag_t *) UF_reallocate_memory( object, (obj_num+1) * sizeof(tag_t), &error );+ e1 A n- A, d9 e. J" y
- UF_free( object );( |- ~. s* e/ g5 B/ `4 a+ H
- char **strings = NULL;- C1 K+ ~* J; _7 ]8 N
- strings = (char **) UF_allocate_memory( 10 * sizeof(char *), &error );
" Q- Z0 c, G: u K; e- x, q- x - for ( i = 0; i < 10; i ++ )
! L" d4 k2 u2 C$ x$ h- `+ p7 g - { strings[i] = NULL;
' J# J& H6 L3 a9 d - strings[i] = (char *) UF_allocate_memory( 133 * sizeof(char), &error );# h9 `- p" W! ^' e( K$ A
- }# Y: G0 h1 q' p3 Z
- UF_free_string_array( 10, strings );* {6 k3 c. p9 H. m
- double (*point_coords)[3];
) N0 @+ E, |) N% ^8 H. A - point_coords = (double (*)[3]) UF_allocate_memory( 10 * sizeof(double [3]), &error );% B7 y/ b3 H% S9 |! r; c
- Static void my_function ( int *num, tag_t **object ): ^. m" p" S: K
- { * @! N2 F, N$ }
- (*num) = 10;$ ]5 P, C1 g$ k# h2 q; L, d0 K
- (*object) = (tag_t *) UF_allocate_memory( (*num) * sizeof(tag_t), &error );
- n3 ~9 J: y& Y( G B3 D - (*object)[0] = NULL_TAG;
# \" ]: B) A( o5 y - }
* t0 ^. t' r& {; |9 @* z; H" K* Q# C
复制代码 typedef struct UF_CURVE_line_s {
# t0 S% @3 m8 ?" o; R double start_point[3];
$ h7 }! F% {" ~4 Y8 q' { double end_point[3]; V& b# }! y2 N- r% H# _/ s6 u* W
} UF_CURVE_line_t, * UF_CURVE_line_p_t;
5 F. H3 T% R' H 6 A6 e# }0 u' n6 A: }2 O
UF_CURVE_line_t my_line; 4 X$ W4 _# J( \1 d. s5 F! F+ @: ]
my_line.start_point[0] = 0.0;
+ ?, H/ m- |+ O: y
* x1 s5 \% F* |! p- S UF_CURVE_line_t *my_line;
w0 d0 j! q7 n my_line->start_point[0] = 0.0;
; K' A2 {1 J& n0 @
4 |9 n2 \9 a! z, N. [$ n UF_CURVE_line_p_t my_line; 0 n$ P3 l# W) B
my_line->start_point[0] = 0.0;" {9 L9 }2 O" _2 V) c# J
& M& |* q# S* z# P. |( b$ x0 }
) i: \( v* _6 A2 H- o |
|