| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 395 人关注过本帖
标题:谁帮我看下哪出问题啦
只看楼主 加入收藏
灰度光阴
Rank: 1
等 级:新手上路
帖 子:7
专家分:7
注 册:2012-10-6
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:5 
谁帮我看下哪出问题啦
#include<stdio.h>
int main(void)
{
    char title[]="longMai C language pointer";
    char*p_title;
    printf("title: %s\n.title");
    p_title=title;
    printf("p_title->title:%s\n".p_title);
    printf("&title=%p\n".&title);
    printf("p_title=%p\n".P_title);
    printf("&title[0]=%p\n".&title[0]);
    return 0;

}--------------------Configuration: Cpp1 - Win32 Debug--------------------
Compiling...
Cpp1.cpp
D:\c语言\指针\1\Cpp1.cpp(8) : error C2228: left of '.p_title' must have class/struct/union type
D:\c语言\指针\1\Cpp1.cpp(9) : error C2059: syntax error : '&'
D:\c语言\指针\1\Cpp1.cpp(10) : error C2228: left of '.printf' must have class/struct/union type
D:\c语言\指针\1\Cpp1.cpp(10) : error C2228: left of '.P_title' must have class/struct/union type
D:\c语言\指针\1\Cpp1.cpp(11) : error C2059: syntax error : '&'
执行 cl.exe 时出错.

Cpp1.obj - 1 error(s), 0 warning(s)
搜索更多相关主题的帖子: return include c语言 pointer 
2012-10-18 22:26
hh373231690
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:67
专家分:138
注 册:2012-10-13
收藏
得分:0 
没看懂你是要干嘛
2012-10-18 22:29
liman123
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:79
专家分:178
注 册:2012-10-6
收藏
得分:11 
#include<stdio.h>//整段代码中的输出后的对象前都应该是逗号,而不是小数点!!
 int main(void)
 {
     char title[]="longMai C language pointer";
     char *p_title;
     printf("title: %s\n",title);//小数点改成逗号!
     p_title=title;
     printf("p_title->title:%s\n",p_title);//同上!
     printf("&title=%p\n",&title);
     printf("p_title=%p\n",p_title);   //第二个P字母打成大写了,应该为小写!
     printf("&title[0]=%p\n",&title[0]);
     return 0;
 
}
2012-10-18 22:40
天剑山
Rank: 4
等 级:业余侠客
威 望:3
帖 子:119
专家分:266
注 册:2012-8-3
收藏
得分:9 
#include<stdio.h>
int main(void)
{
    char title[]="longMai C language pointer";
    char*p_title;
    printf("title: %s\n.", title);//printf 函数调用错误
    p_title=title;
    printf("p_title->title:%s\n", p_title);//是","而不是"."
    printf("&title=%p\n",&title);
    printf("p_title=%p\n",p_title);//注意变量名称的大小写
    printf("&title[0]=%p\n",&title[0]);
    return 0;

}
2012-10-20 14:32
灰度光阴
Rank: 1
等 级:新手上路
帖 子:7
专家分:7
注 册:2012-10-6
收藏
得分:0 
回复 3楼 liman123
新手就是一直犯错
2012-10-22 18:27
Demoon
Rank: 2
等 级:论坛游民
帖 子:16
专家分:34
注 册:2012-9-12
收藏
得分:0 
内容不能为空

2012-10-23 22:25
快速回复:谁帮我看下哪出问题啦
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011761 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved