Advertisement
dllbridge

Untitled

Apr 15th, 2023
806
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.19 KB | None | 0 0
  1.  
  2.  
  3. #include       <stdio.h>
  4. #include      <stdlib.h>    
  5.  
  6. ///////////////////////////
  7. struct TT
  8. {
  9.      int nInf;
  10.      int nKey;
  11.      
  12.      TT *pNext;
  13. };
  14.  
  15.  
  16.  
  17. TT *ptt =  new(TT);
  18.  
  19. TT &one = *ptt;
  20.      
  21.      
  22. ////////////////////////////////////////////////////
  23. int main()                                        //    printf("a = %d\n", a);
  24. {
  25.  
  26.   (*ptt).nInf = 12;    printf("VOID = %d\n", (*ptt).nInf);     
  27.     ptt->nInf =  6;    printf("VOID = %d\n",   ptt->nInf);         
  28.     one.nInf  =  7;    printf("VOID = %d\n",    one.nInf);
  29.        
  30.     delete(ptt);
  31. }
  32.  
  33.  
  34.  
  35.  
  36.  
  37. /*int *p2 = p;    
  38. int &a = *p = 0;
  39.  
  40. #include       <stdio.h>
  41. #include      <stdlib.h>    
  42.  
  43.  
  44.  
  45. int *p =  new(int); //(int*)malloc(sizeof(int) );   //
  46.  
  47. int *p2 = p;    
  48. int &a = *p = 0;
  49.    
  50.    
  51.    
  52.    
  53.      
  54.      
  55. ////////////////////////////////////////////////////
  56. int main()                                        //
  57. {
  58.    
  59.     int nRes =  sizeof(char);
  60.    
  61.     printf("a = %d\n", a);
  62.    
  63.    
  64.    
  65.     delete(p2);
  66.    
  67. }
  68. */
  69.  
  70.  
  71.  
  72. /*
  73.  
  74. #include       <stdio.h>
  75. #include      <stdlib.h>    
  76.  
  77.  
  78.  
  79. int *p = (int*)malloc(sizeof(int) );
  80.  
  81. int *p2 = p;    
  82. int &a = *p = 0;
  83.    
  84.    
  85.    
  86.    
  87.      
  88.      
  89. ////////////////////////////////////////////////////
  90. int main()                                        //
  91. {
  92.    
  93.     int nRes =  sizeof(char);
  94.    
  95.     printf("a = %d\n", a);
  96.    
  97.    
  98.    
  99.     free(p2);
  100.    
  101. }
  102. */
  103.  
  104. /*
  105.  
  106. #include       <stdio.h>
  107. #include      <stdlib.h>    
  108.  
  109.  
  110.  
  111. int *p = (int*)malloc(4868);
  112.  
  113. int *p2 = p;    
  114. int &a = *p = 0;
  115.    
  116.    
  117.    
  118.    
  119.      
  120.      
  121. ////////////////////////////////////////////////////
  122. int main()                                        //
  123. {
  124.    
  125.     int nRes =  sizeof(char);
  126.    
  127.     printf("a = %d\n", a);
  128.    
  129.    
  130.    
  131.     free(p2);
  132.    
  133. }
  134. */
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145. /*
  146.  
  147. #include      <cstdio>
  148.    
  149. struct YY
  150. {
  151.    
  152.     int n;
  153.  
  154.     int *p;
  155.    
  156.     char c;
  157. };
  158.    
  159.    
  160.    
  161.    
  162.      
  163.      
  164. ////////////////////////////////////////////////////
  165. int main()                                        //
  166. {
  167.    
  168.     int nRes =  sizeof(char);
  169.    
  170.     printf("size of char = %d\n", nRes);
  171.    
  172.    
  173. }
  174. */
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. /*
  196. #include      <cstdio>
  197.    
  198. char sz1[ 44] =      "SONY",   
  199.      sz2[199] = "_Pictures.1";
  200.    
  201.  
  202.  
  203. int _strlen(char *);     
  204.      
  205. ////////////////////////////////////////////////////
  206. int main()                                        //
  207. {
  208.    
  209.     int nRes = _strlen(sz2);
  210.  
  211.     printf("strlen return = %d\n", nRes);  
  212. }
  213.  
  214.  
  215. ////////////////////////////////////////////////////
  216. int _strlen(char *psz)                            //
  217. {
  218.    
  219.     int i = 0;
  220.    
  221. L_01:
  222.            
  223.     if(psz[++i] != 0) goto L_01;
  224.    
  225.    
  226.    
  227. return i;  
  228. }
  229.  
  230.  
  231.  
  232. */
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240. /*
  241.  
  242.  
  243. #include      <cstdio>
  244.    
  245. char sz1[ 44] =      "SONY",   
  246.      sz2[199] = "_Pictures.";
  247.    
  248.  
  249.  
  250. int _strlen(char *);     
  251.      
  252. ////////////////////////////////////////////////////
  253. int main()                                        //
  254. {
  255.    
  256.     int nRes = _strlen(sz2);
  257.  
  258.     printf("strlen return = %d\n", nRes);  
  259. }
  260.  
  261.  
  262. ////////////////////////////////////////////////////
  263. int _strlen(char *psz)                            //
  264. {
  265.    
  266.     int n = 0;
  267.    
  268.     for(int i = 0; psz[i] != 0; i ++ )
  269.     {
  270.        
  271.         n ++;
  272.     }
  273.    
  274.    
  275. return n;  
  276. }
  277.  
  278. */
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement