ch8_20.cpp
资源名称:c.rar [点击查看]
上传用户:puke2000
上传日期:2022-07-25
资源大小:912k
文件大小:0k
源码类别:

C#编程

开发平台:

Visual C++

  1. //**********************
  2. //**    ch8_20.cpp    **
  3. //**********************
  4. #include <iostream.h>
  5. void Print(char*[],int);
  6. void main()
  7. {
  8.   char* pn[]={"Fred","Barney","Wilma","Betty"};
  9.   int num =sizeof(pn)/sizeof(char*);
  10.   Print(pn,num);
  11. }
  12. void Print(char* arr[], int len)
  13. {
  14.   for(int i=0; i<len; i++)       //输出各字符串
  15.     cout <<(int)arr[i] <<"  "    //输出字符串地址