Advertisement
dllbridge

Untitled

Oct 11th, 2023
736
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1.  
  2. #include   <stdio.h>
  3. #include   <string.h>
  4.  
  5. //////////////////////////////////////////////
  6. class _String
  7. {
  8.    
  9.     int nLen;
  10.     int    i;
  11.    
  12.     public:
  13.     char sz[1000];
  14.    
  15.     ///////////////////////
  16.    _String()
  17.     {
  18.        
  19.         nLen  = 0;
  20.         sz[0] = 0;
  21.     }
  22.    
  23.     ///////////////////////
  24.     void get(const char* a)
  25.     {
  26.          nLen = strlen(a);
  27.          strcpy(sz, a);    
  28.     }  
  29. };
  30.  
  31.  
  32.  
  33. ////////////////////////////////////////////////////
  34. int main()                                        //
  35. {
  36.  
  37.    _String s1;
  38.    
  39.    
  40.    s1.get("World");
  41.  
  42.  
  43. }
  44.  
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement