【学习笔记】【C语言】返回指针的函数

函数如果带*的返回的就是指针

char *test()
{
 }

 1 #include <stdio.h>
 2 char *test();
 3 
 4 /*
 5  返回指针的函数
 6  */
 7 
 8 int main()
 9 {
10     char *name = test();
11     
12     printf("name=%s\n", name);
13     
14     return 0;
15 }
16 
17 char *test()
18 {
19     return "rose";
20 }

 

 
posted @ 2015-06-25 22:56  登山赏枫  阅读(208)  评论(0编辑  收藏  举报