return用法求教

return 是是不是可返回所有基本类的变量
如果返回指针变量可以吗?
分配int 类型空间
则是年int *p = (int*)malloc(sizefo(int)*8)??;

一、不及物动词 vi.

1、回,返回,归[(+to/from)]

She did not return home till eleven o'clock. 她十一点钟才回家。

2、重新发生;回复,恢复[(+to)]

The situation has returned to normal in the capital. 首都的局势已恢复正常。

3、归还,退回[(+to)]

4、回答;反驳

二、及物动词 vt.

1、还,归还;送回[(+to)][O1]

Have you returned the novel to the library?那本小说你还给图书馆了吗?

2、回答,回报;报答

We decided to return blow for blow.我们决定以牙还牙。

3、选举,选出[(+to)]

4、【律】(陪审团)正式宣布(裁决)

5、获得,产生(利润等)

The performance returned $2,000 over expenses.这场演出除去开支赢余2000元。

6、报告;申报

7、反射(光、声等)

8、回答说;反驳道

三、名词 n.

1、回,归,返回[C][U][(+from/to)

On his return he reported his findings to the committee.他一回来就向委员会报告调查结果。

2、还,归还[U]

3、回答;报答[U][C]

He expected no return when he decided to give us full support.他决定全力支持我们时并无图报之意。

4、回复;复发;恢复;再现[U][C]

She had a return of the heart attacks.她心脏病又发作了。

5、收益,利润;利息[P1]

6、报告书;申报;报表[C]

7、【英】来回票[C]

8、退货[P]

四、形容词 adj

1、返回的,回程的;来回的

2、报答的;回报的

The professor paid a return visit to his American colleague.教授回访了美国同事。

3、返回的,折回的

参考资料来源:百度百科-return

温馨提示:答案为网友推荐,仅供参考
第1个回答  2008-02-25
可以

不过楼上那样用要小心
内存分配了没有释放
使用fun()小心内存泄露

---------------------------------------
分配int 类型空间
则是年int *p = (int*)malloc(sizefo(int)*8)??;
---------------------------------------
不是
你把malloc的介绍文档看一看吧
书上说的比上网问来的快
char *p = (char*)malloc(sizefo(char)*8);
中sizefo(char)*8是分配8个char空间用来保存 "Hello"(实际只用了6个char)
而int *p = (int*)malloc(sizefo(int)*8)??;
这里*8就不要了
第2个回答  2008-02-25
可以的
char* fun()
{
char *p = (char*)malloc(sizefo(char)*8);
strcpy(p,"Hello");
return p;
}本回答被提问者采纳
第3个回答  2020-11-07
第4个回答  2020-11-07
相似回答