Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int foo(int *p);
- ////////////////////////////////////////////////////
- int main() //
- {
- int nArr[10] = {100, 101, 102, 103};
- int n = foo(nArr);
- printf("Summa = %d\n", n);
- }
- /////////////////////////////////////////////////////
- int foo(int *p) //
- {
- int nSumm = 350;
- nSumm = *p;
- nSumm = p[1];
- return nSumm;
- }
- /*
- #include <stdio.h>
- #include <string.h>
- FILE *pf;
- char sz[99];
- ////////////////////////////////////////////////////
- int main() //
- {
- pf = fopen("hello.txt", "r" );
- if(pf != 0) printf("File open OK\n"); // Error!
- for(int i = 0; i < 2; i++)
- {
- fscanf(pf, "%s", sz);
- printf("%s\n " , sz);
- }
- fclose (pf);
- }
- */
- /*
- #include <stdio.h>
- #include <string.h>
- FILE *pf;
- ////////////////////////////////////////////////////
- int main() //
- {
- pf = fopen("PICTURES.c", "w" );
- if(pf != 0) printf("File open OK\n"); // Error!
- fprintf(pf, "%s\n", "psz PICTURES.c");
- fclose (pf);
- }
- */
- /*
- #include <stdio.h>
- #include <string.h>
- FILE *pf;
- int f_w(const char *psz);
- ////////////////////////////////////////////////////
- int main() //
- {
- //int n = f_w("Kino");
- pf = fopen("hello.txt", "w" );
- // if(pf != 0) return 0; // Error!
- fprintf(pf, "%s\n", "psz");
- fclose (pf);
- //printf("n = %d\n", n);
- }
- ////////////////////////////////////////////////////
- int f_w(const char *psz) //
- {
- pf = fopen("hello.txt", "w" );
- if(pf != 0) return 0; // Error!
- fprintf(pf, "%s\n", psz);
- fclose (pf);
- return 1; // Sucess
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement