A little bit of pointer knowledge

Source: Internet
Author: User

Blogger: This doll is quite appetizing.

1: Self: http://www.360doc.com/content/11/0925/16/6527018_151129737.shtml

A lot of people say that the flood of animals is actually the same thing.

 

2: A little analysis of character pointers and integer pointers

From: http://blog.csdn.net/ghost1236/article/details/6309809

Nice.

 

 

# Include <stdio. h>
# Include <stdlib. h>
/* Int main (void)
{
Int * PI;
Char * PC;
Long * pl;
Char A [] = "abcdefg ";
Int B = 10000;
Printf ("the sizeof int * is % d \ n", sizeof (PI ));
Printf ("the sizeof char * is % d \ n", sizeof (PC ));
Printf ("the sizeof long * is % d \ n", sizeof (PL ));
Pi =;
Printf ("array: the sizeof Int Is % s \ n", Pi );
PC =;
Printf ("array: the sizeof char is % s \ n", PC );
PL =;
Printf ("array: the sizeof long is % s \ n", PL );
* Pi = B;
Printf ("char number: the sizeof Int Is % d \ n", * PI );
* Pc = B;
Printf ("char number: the sizeof char is % d \ n", * PI );
* PL = B;
Printf ("char number: the sizeof long is % d \ n", * PI );

Return 0;
}*/

/* Int main (INT argc, char * argv [])
{

Char day [15] = "abcdefghijklmn ";
Char * strtmp = "opqrstuvwxyz ";

Printf ("& Day is % x \ n", & Day );
Printf ("& day [0] is % x \ n", & day [0]);
Printf ("Day is % x \ n", Day );

Printf ("\ n & strtmp is % x \ n", & strtmp );
Printf ("& strtmp [0] is % x \ n", & strtmp [0]);
Printf ("strtmp is % x \ n", strtmp );

Getchar ();
Return 0;
}*/
Int main (INT argc, char * argv [])
{
Char * c = "123456 ";
Int * I = "123456 ";

Printf ("& C is % d \ n", & C );
Printf ("C is % x \ n", C );
Printf ("* C is % s \ n", C );
C ++;
Printf ("C ++ \ n & C is % d \ n", & C );
Printf ("C is % x \ n", C );
Printf ("* C is % s \ n", C );
* C ++;
Printf ("* C ++ \ n & C is % d \ n", & C );
Printf ("C is % x \ n", C );
Printf ("* C is % s \ n", C );

Printf ("\ n & I is % d \ n", & I );
Printf ("I is % x \ n", I );
Printf ("* I is % s \ n", I );
I ++;
Printf ("2222 I ++ \ n & I is % d \ n", & I );
Printf ("I is % x \ n", I );
Printf ("* I is % s \ n", I );
 
 
Printf ("3333 * I ++ \ n & I is % d \ n", & I );
Printf ("I is % x \ n", I );
Printf ("* I is % s \ n", I );

Return 0;
}

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.