我有以下代碼初學者編碼器:
int main()
{
struct* Array[malloc(10*sizeOf(struct)];
/* I then fill the struct. (int num,float points)
* I then want to pass this array that I've filled up to a sortList function,
* which then outputs the sorted array back to main().
*
* Then I want to output the array as: "number, points" */
}
struct struct
{
int number;
float points;
}
void sortList()
{
/*sort Array, then return sorted array*/
}
我將如何傳遞數組,然後回來?
任何鏈接或建議都非常有幫助。
'結構*數組[malloc的(10 *整型尺寸(結構)];'哪種語言 –
'結構*數組[malloc的(10 *整型尺寸(結構)〕;'這是什麼有人教' malloc()'今天錯了,第二篇文章有這樣一個嚴重問題 –
這是C.對不起,這就是我學會如何分配內存給一個有10個條目的數組! – starter1011