Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- char sz[99] = "SONY_Pictures",
- *psz = &sz[2];
- /////////////////////////////////
- int main() //
- {
- printf(" sz = %d\n", sz);
- printf("*psz = %d\n", *psz);
- }
- /*
- #include <stdio.h>
- #include <string.h>
- char sz1[99] = "SONY_Pictures",
- sz2[99];
- int _strlen(char *);
- /////////////////////////////////
- int main() //
- {
- strcpy(sz2, sz1);
- printf("sz2 = %s\n", sz2);
- int n = _strlen(sz1);
- printf("n = %d\n", n);
- }
- ///////////////////////////////////////
- int _strlen(char *psz)
- {
- int n = 0;
- for(int i = 0; i < 10000; i++)
- {
- if(psz[i] != 0) n = n + 1;
- else break;
- }
- return n;
- }
- ///////////////////////////////////////
- void _strcpy(char *psz1, char *psz2)
- {
- }
- */
- /*
- #include <stdio.h>
- char c = 49;
- /////////////////////////////////
- int main() //
- {
- printf("c = %c\n", c);
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- /////////////////////////////////
- int main() //
- {
- srand(time(0));
- for(int i = 0; i < 10; i ++)
- {
- printf("%d\n", rand() );
- }
- }
- */
- /*
- #include <stdlib.h>
- #include <time.h>
- #include <stdio.h>
- /////////////////////////////////
- int main() //
- {
- srand(time(0));
- int array[20],
- nx,
- ng;
- for(int i = 0; i < 20; i++)
- {
- array[i] = rand();
- }
- ng = array[0];
- for(int i = 0; i < sizeof(array)/4; i++ )
- {
- if (array[i] > nx) nx = array[i];
- }
- printf("min array: %d\n", ng);
- printf("max array: %d\n", nx);
- return 0;
- }
- */
- /*
- #include <stdio.h>
- /////////////////////////////////
- int main() //
- {
- int array[20] = { 1, 12, 43, 54, 4, 12, 3, 5, 8, 55,
- 8, 431, 667, 12, 87, 45, 2, 345, 99, 16},
- nx,
- ng = array[0];
- for(int i = 0; i < sizeof(array)/4; i++ )
- {
- if (array[i] > nx) nx = array[i];
- }
- printf("min array: %d\n", ng);
- printf("max array: %d\n", nx);
- return 0;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement