Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- char *ppsz[14];
- void monitor();
- //////////////////////////////////////////////////////////
- int main() //
- {
- char *psz = (char*)malloc(15);
- strcpy(psz, "January");
- ppsz[1] = psz;
- monitor();
- }
- //////////////////////////////////////////////////////////
- void monitor()
- {
- for(int i = 1; i < 2; i++)
- {
- printf("%s\n", ppsz[i]);
- }
- }
- /*
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- //////////////////////////////////////////////////////////
- int main() //
- {
- char *psz = (char*)malloc(5);
- // psz[0] = 'S';
- // psz[1] = 'O';
- // psz[2] = 'N';
- // psz[3] = 'Y';
- // psz[4] = 0 ;
- strcpy(psz, "SONY");
- printf("%s\n", psz);
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- //////////////////////////////////////////////////////////
- int main() //
- {
- char *psz = (char*)malloc(5);
- psz[0] = 'S';
- psz[1] = 'O';
- psz[2] = 'N';
- psz[3] = 'Y';
- psz[4] = 0 ;
- printf("%s\n", psz);
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- void monitor(int *p, int);
- //////////////////////////////////////////////////////////
- int main() //
- {
- int n;
- scanf("%d", &n);
- printf("n = %d\n", n);
- int *p = (int*)malloc(n * 4);
- for(int i = 0; i < n; i++)
- {
- p[i] = rand()%200;
- }
- monitor(p, n);
- free(p);
- }
- ///////////////////////////////////////////////////
- void monitor(int *p, int n)
- {
- for(int i = 0; i < n; i++)
- {
- printf("%d\n", p[i]);
- }
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- int n = 7;
- namespace Sobolev
- {
- int n = 99999;
- }
- //////////////////////////////////////////////////////////
- int main() //
- {
- int *p = (int*)malloc(4);
- *p = 24;
- printf("*p = %d\n", *p);
- int &r = *p;
- printf(" r = %d\n", r);
- }
- */
- /*
- #include <stdio.h>
- int n = 7;
- namespace Sobolev
- {
- int n = 99999;
- }
- //////////////////////////////////////////////////////////
- int main() //
- {
- int n = 123;
- printf("n = %d\n", n);
- printf("n = %3d\n", ::n);
- printf("Sobolev::n = %d\n", Sobolev::n);
- }
- */
- /*
- #include <stdio.h>
- //////////////////////////////////////////////////////////
- int main() //
- {
- int nArr[30];
- for(int i = 0; i < 31; i ++ ) nArr[i] = i;
- for(int i = 3; i < 31; i +=3) nArr[i] = 100;
- printf("nArr = " );
- for(int i = 0; i < 31; i ++ ) printf("%3d ", nArr[i]);
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement