Conditionally set a variable if it's NULL

后端 未结 2 1955
无人及你
无人及你 2021-01-21 23:16

When stepping through a sqlite3_stmt, I\'d like to check against a return value of NULL rather than store it and check against the stored value.

<
2条回答
  •  长情又很酷
    2021-01-22 00:00

    Does this work?

    char *email;
    // Reviewed by "R." to verify sequence point correctness.
    email = (email = (char *)sqlite3_column_text(statement, 10))? email : "";
    

提交回复
热议问题