f0408.cpp

来自「it is a usefull thing」· C++ 代码 · 共 18 行

CPP
18
字号
//=====================================
// f0408.cpp
// C-串拷贝
//=====================================
#include<iostream>
//-------------------------------------
char* myStrcpy(char* s1, const char* s2){
  char* s = s1;
  while(*s++ = *s2++);
  return s1;
}//------------------------------------
int main(){
  char a[50];
  const char* s="Hello, I am a student.\n";
  std::cout<<myStrcpy(a,s);
}//====================================

 

⌨️ 快捷键说明

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