Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- //////////////////////////////////////////////////
- int main() //
- {
- char sz[9] = "SONY",
- *p = &sz[1];
- printf("%s\n", (p -1));
- printf("%s\n", &p[-1]);
- printf("%s\n", &(*(&(&p[-1])[0])));
- }
- /*
- #include <stdio.h>
- //////////////////////////////////////////////////
- int main() //
- {
- char sz1[9] = "SONY";
- char sz2[9] = {115, 49, 'N', 'Y'};
- printf(sz1 );
- printf(sz2 );
- printf("\n");
- printf("sz2 = %s, %d\n", sz2, 646);
- printf("sz1 = %s\n", sz1);
- }
- */
- /*
- #include<iostream>
- using namespace std;
- //////////////////////////////////////////////////
- int main() //
- {
- int nArr[] = {20, 33, 22, 23}, // kljklj
- *p = nArr,
- i = 0 ; // kljlkjlj
- L_01:
- cout << p[i] << " ";
- cout << p+i << endl;
- if(i < 4) { i++; goto L_01; }
- cout << "&i = " << &i << endl;
- cout << " i = " << i << endl;
- return 0;
- }
- */
- /*
- #include<iostream>
- using namespace std;
- //////////////////////////////////////////////////
- int main() //
- {
- int nArr[] = {20, 333, 22, 23}, // kljklj
- *p = nArr; // kljlkjlj
- for(int i=0; i<4; i++)
- {
- cout << p[i] << " ";
- cout << p+i << endl;
- }
- return 0;
- }
- */
- /*
- #include<iostream>
- using namespace std;
- int main()
- {
- int nArr[] = {20, 21, 22, 23}, // kljklj
- *p=nArr; // kljlkjlj
- for(int i=0; i<4; i++)
- {
- cout << *(p+i) << " ";
- cout << p+i << endl;
- }
- return 0;
- }
- */
- /*
- #include<iostream>
- using namespace std;
- int main()
- {
- int nArr[] = {20, 21, 22, 23}, // kljklj
- *p=nArr; // kljlkjlj
- for(int i=0; i<4; i++)
- {
- cout << *(p+i) << " ";
- cout << &i << endl;
- }
- return 0;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement