标题:指针的问题
取消只看楼主
adsl520
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-3-14
 问题点数:0 回复次数:0 
指针的问题
# include<stdio.h>
void main()
{
    char str[][10] = {"China","Beijing"},*p = str;
    printf("%s\n",p + 10);
}
请问高手哪里错了~~~~~我想要的答案是Beijing
VC++里的报错资料如下:
--------------------Configuration: 69 - Win32 Debug--------------------
Compiling...
9.cpp
D:\Microsoft Visual Studio\MyProjects\69\9.cpp(5) : error C2440: 'initializing' : cannot convert from 'char [2][10]' to 'char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
D:\Microsoft Visual Studio\MyProjects\69\9.cpp(6) : error C2065: 'printf' : undeclared identifier
执行 cl.exe 时出错.

69.exe - 1 error(s), 0 warning(s)


[ 本帖最后由 adsl520 于 2010-3-15 20:02 编辑 ]
搜索更多相关主题的帖子: conversion Microsoft convert include cannot 
2010-03-14 20:05



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-299417-1-1.html




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

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