Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- ///////////////////////////
- struct TT
- {
- int nInf;
- int nKey;
- TT *pNext;
- };
- TT *ptt = new(TT);
- TT &one = *ptt;
- ////////////////////////////////////////////////////
- int main() // printf("a = %d\n", a);
- {
- (*ptt).nInf = 12; printf("VOID = %d\n", (*ptt).nInf);
- ptt->nInf = 6; printf("VOID = %d\n", ptt->nInf);
- one.nInf = 7; printf("VOID = %d\n", one.nInf);
- delete(ptt);
- }
- /*int *p2 = p;
- int &a = *p = 0;
- #include <stdio.h>
- #include <stdlib.h>
- int *p = new(int); //(int*)malloc(sizeof(int) ); //
- int *p2 = p;
- int &a = *p = 0;
- ////////////////////////////////////////////////////
- int main() //
- {
- int nRes = sizeof(char);
- printf("a = %d\n", a);
- delete(p2);
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- int *p = (int*)malloc(sizeof(int) );
- int *p2 = p;
- int &a = *p = 0;
- ////////////////////////////////////////////////////
- int main() //
- {
- int nRes = sizeof(char);
- printf("a = %d\n", a);
- free(p2);
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- int *p = (int*)malloc(4868);
- int *p2 = p;
- int &a = *p = 0;
- ////////////////////////////////////////////////////
- int main() //
- {
- int nRes = sizeof(char);
- printf("a = %d\n", a);
- free(p2);
- }
- */
- /*
- #include <cstdio>
- struct YY
- {
- int n;
- int *p;
- char c;
- };
- ////////////////////////////////////////////////////
- int main() //
- {
- int nRes = sizeof(char);
- printf("size of char = %d\n", nRes);
- }
- */
- /*
- #include <cstdio>
- char sz1[ 44] = "SONY",
- sz2[199] = "_Pictures.1";
- int _strlen(char *);
- ////////////////////////////////////////////////////
- int main() //
- {
- int nRes = _strlen(sz2);
- printf("strlen return = %d\n", nRes);
- }
- ////////////////////////////////////////////////////
- int _strlen(char *psz) //
- {
- int i = 0;
- L_01:
- if(psz[++i] != 0) goto L_01;
- return i;
- }
- */
- /*
- #include <cstdio>
- char sz1[ 44] = "SONY",
- sz2[199] = "_Pictures.";
- int _strlen(char *);
- ////////////////////////////////////////////////////
- int main() //
- {
- int nRes = _strlen(sz2);
- printf("strlen return = %d\n", nRes);
- }
- ////////////////////////////////////////////////////
- int _strlen(char *psz) //
- {
- int n = 0;
- for(int i = 0; psz[i] != 0; i ++ )
- {
- n ++;
- }
- return n;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement