Can the alliance initialize in the statement?

For example, suppose we have a union

typedef union {
unsigned long U32;
float f;
}U_U32_F;

Is there any way to set the initial value when declaring this union type variable?

U_U32_F u = 0xffffffff; // Does not work...is there a correct syntax for this?

Use the initialization list:

U_U32_F u = {0xffffffff };

You can set other members except the first one

U_U32_F u = {.f = 42.0 };

For example, suppose we have a union

typedef union {
unsigned long U32;
float f;
}U_U32_F;

Is there a way to set the initial value when declaring this union type variable?

U_U32_F u = 0xffffffff; // Does not work...is there a correct syntax for this?

Use the initialization list:

U_U32_F u = {0xffffffff };

You can set other members except the first one

U_U32_F u = {.f = 42.0 };

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3023 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.