[問題] 兩個struct交互使用的宣告問題

看板C_and_CPP (C/C++)作者 (rtt)時間13年前 (2013/05/10 17:54), 編輯推噓0(002)
留言2則, 2人參與, 最新討論串1/1
各位大大,小弟最近閱讀openssl source code,並試著改寫 有個部分感到很疑惑,兩個檔案的程式碼如下: ----------------------------------- //在 ossl_type.h typedef struct evp_cipher_st EVP_CIPHER typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX ------------------------------------ //在evp.h struct evp_cipher_st { int (*init)(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc); //其他略 } struct evp_cipher_ctx_st { const EVP_CIPHER *cipher; //其他略 } ------------------------------------ 這兩個結構交互使用,不管如何改先後順序,compiler只會認得先宣告的struct 請問有方法讓compiler都認得嗎? 感謝回覆! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.200.169.82

05/10 18:43, , 1F
http://codepad.org/00QAHc0a struct定義完要;結束
05/10 18:43, 1F

05/11 10:04, , 2F
感謝大大!!
05/11 10:04, 2F
文章代碼(AID): #1HZCEuZ2 (C_and_CPP)
文章代碼(AID): #1HZCEuZ2 (C_and_CPP)