我有以下代码初学者编码器:
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