Beginners should be skilled by the application pointer

xiaoxiao2021-03-06  84

#include

Int main (void)

{

INT RR = 1;

INT * PTY;

Pty = & rr; // Put the address of the variable to Pty

Printf ("% d / n", rr);

Printf ("% d / n", * pty); / / / / The pointer with indirect operation symbol in this program is data to the variable itself.

Printf ("% d / n", & rr);

Printf ("% D / N", PTY); // In this program, a pointer without an indirect operation symbol is the address of the variable.

Getch ();

}

#include

Int main (void)

{

INT RR = 1;

INT * PTY;

Pty = rr; // Assign the data of the variable to the Pty

Printf ("% d / n", rr);

Printf ("% d / n", * pty); / / / / pointer with indirect operation symbol in this program is the address of the variable

Printf ("% d / n", & rr);

Printf ("% d / n", pty); // In this program, a pointer without indirect operation symbol is data to the variable itself.

Getch ();

}

转载请注明原文地址:https://www.9cbs.com/read-95220.html

New Post(0)