0

正如问题所暗示的那样,我们可以从函数中返回结构吗?

(struct spMat z) fastTranspose(struct spMat x[20])
{
 //did the process to store transpose in z

 return(z);
}

但现在我收到错误错误:预期标识符或“结构”之前的“(”

谁能告诉我我做错了什么?

提前谢谢。

4

1 回答 1

0

我想你想这样做:

struct spMat fastTranspose(struct spMat x[20])
{
     //declare a new struct if you need

     ...

     return x; // or the new struct which you declared before
}
于 2013-08-21T02:36:05.650 回答