f0408.cpp
Upload User: puke2000
Upload Date: 2022-07-25
Package Size: 912k
Code Size: 0k
Category:

CSharp

Development Platform:

Visual C++

  1. //=====================================
  2. // f0408.cpp
  3. // C-串拷贝
  4. //=====================================
  5. #include<iostream>
  6. //-------------------------------------
  7. char* myStrcpy(char* s1, const char* s2){
  8.   char* s = s1;
  9.   while(*s++ = *s2++);
  10.   return s1;
  11. }//------------------------------------
  12. int main(){
  13.   char a[50];
  14.   const char* s="Hello, I am a student.n";
  15.   std::cout<<myStrcpy(a,s);
  16. }//====================================
  17.