标题:关于数组元素的输出。#include<iostream> #include<cstring> using namespa ...
取消只看楼主
未未来
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:182
专家分:157
注 册:2012-11-6
结帖率:94.87%
 问题点数:0 回复次数:1 
关于数组元素的输出。#include<iostream> #include<cstring> using namespace::std;
程序代码:
#include<iostream>
using namespace::std;
int main(){
       const size_t  i=5;
       int shu[i]={
             
       2,2,3,3,3};
      
       for(int *p=shu,*q=shu+i;p!=q;++p){
              *p=0; 

cout<<*p<<" ";      }
       return 0;
}

程序代码:
#include<iostream>
#include<cstring>
using namespace::std;
int main(){

char ca1[]={'d','s','a','s','f'};
char *p=ca1;


cout<<p;
return 0;}

char[]的输出和普通数组的输出不同吗 求解答。
搜索更多相关主题的帖子: include 输出 namespace color 元素 
2013-01-29 16:20
未未来
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:182
专家分:157
注 册:2012-11-6
得分:0 
回复 2楼 rjsp
十分感谢。
2013-01-30 15:32



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




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

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