Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- char *foo();
- char foo2(char *);
- char c = 'A',
- c2 = 'B',
- *pc = &c;
- int* n = 0,
- n2 = 11;
- char sz[99] = "SONY Pictures";
- /////////////////////////////////////////////////c
- int main()
- {
- char *p = foo();
- c2 = foo2(sz);
- printf("Address of p = %d\n", p);
- printf(" *p = %d\n", *p);
- printf(" *p = %c\n", *p);
- printf(" c2 = %c\n", c2);
- }
- ////////////////////////////////////////////////////
- char *foo()
- {
- return &c;
- }
- ////////////////////////////////////////////////////
- char foo2(char *p)
- {
- printf("p[7] = %c\n", p[7]);
- return c;
- }
- /*
- #include <stdio.h>
- char *foo();
- char c = 'A';
- /////////////////////////////////////////////////c
- int main()
- {
- char *p = foo();
- printf("Address of p = %d", p);
- printf(" *p = %d",*p);
- printf(" *p = %c",*p);
- }
- ////////////////////////////////////////////////////
- char *foo()
- {
- return &c;
- }
- */
- /* ERROR
- #include <stdio.h>
- char *foo();
- /////////////////////////////////////////////////c
- int main()
- {
- char *p = foo();
- }
- ////////////////////////////////////////////////////
- char *foo()
- {
- extern char c = 'A';
- return &c;
- }
- */
- /*
- #include <stdio.h>
- char* foo(char *a);
- int aaa();
- /////////////////////////////////////////////////char foo(char *a);
- int main()
- {
- char phrase[] = "SONY Pictures";
- char* psz = foo(phrase);
- printf("&phrase[5] = %x\n", &phrase[5]);
- printf(" psz = %p\n", psz);
- printf("*psz = %c\n", *psz);
- return 0;
- }
- ///////////////////////////////////////////////char *ph;
- char* foo(char *a)
- {
- a = a + 5;
- return a;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement