簡體   English   中英

如何在C中調用函數

[英]How to call a function in C

我試圖找出如何從main()調用給定的函數。

void initialize(struct word_pair word_table[], int size)

例如, initialize ( what, 5);

我是C的新手,我覺得這讓我頭腦中的一切都搞砸了。

這是一個示例用法:

#define SIZE 10
struct word_pair word_tables[SIZE];

// Populate the elements of word_tables

initialize(word_tables, SIZE);

initialize()函數有兩個參數:

  • struct word_pair的數組
  • 數組的大小。

在上面的示例中,變量word_tables是一個大小為SIZE的數組。

SIZE是上面示例中定義為10macro ,但您可以根據需要進行更改。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM