⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ptr_aray.cpp

📁 数据结构常用算法合集
💻 CPP
字号:
//ptr_aray.cpp
#include <iostream.h>
#include <conio.h>
void putstr_array(char *);
void putstr_ptr(char *);

void main()
{ char *str="This ia a books.";
  putstr_array(str);
  putstr_ptr(str);
  getch();
}

//index s as array
void putstr_array(char *s)
{ for (int i=0;s[i];i++)
  cout << s[i];
  cout << endl;
}

//Access as a pointer
void putstr_ptr(char *s)
{ while (*s)
  cout << *s++;
  cout << endl;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -