C语言实验报告指针(二)6,C语言实验报告——指针.doc

C语言实验报告——指针

实验6 指 针

姓名:刘磊 学号:1100530124 实验日期实验目的和要求

(1)掌握指针的概念、指针变量定义格式和引用。

(2)掌握指针的运算方法。

(3)掌握数组的指针和指向数组的指针变量。

(4)掌握指针与函数的关系。

(5)能正确使用字符串的指针和指向字符串的指针变量。

(6)了解指向函数的指针。

(7)了解指向指针变量的指针。

实验内容:实验指导书中的实验九。

实验步骤

9.1 调试程序,找出程序的错误。

9.2 运行程序:

9.3 修改程序错误,并运行。

9.4. 程序填空:

9.5. 程序填空:

#include

main()

{

int a[5][5]={0},*p[5],i,j;

for(i=0; i<5; i++) p[i]= &a[i][0] ;

for(i=0; i<5; i++)

{*(p[i]+ i) =1;

*(p[i]+5- (i+1)) =1;

}

for(i=0; i<5; i++)

{

for(j=0; j<5; j++)

printf("%2d", p[i][j]);

;

}

}

9.6 编程(选作)

运行结果(请帖图):

97. 运行程序(选作):

4、实验心得:

指针是很好的工具,是的程序更加灵活。但是在使用的时候,要注意指针使用的规则,一定要初始化指针,掌握指针的单向传递规律,辨析实参与形参之间变量传递的方向性。而且指针不能滥用

to prevent the accumulation of air, both ends of the tube are required the Center to bake. 6.2.5 sets should be at the bottom 200mm lashing cable head is fixed rung, with a similar cable color of plastic lashings. Cable head using "equal-width stacked" layout, or according to the size and space within the enclosure cable volume adjust, but you must ensure uniform, neat and elegant. 6.2.6 disc cabinet within cable shield layer requirements

to prevent the accumulation of air, both ends of the tube are required the Center to bake. 6.2.5 sets should be at the bottom 200mm lashing cable head is fixed rung, with a similar cable color of plastic lashings. Cable head using "equal-width stacked" layout, or according to the size and space within the enclosure cable volume adjust, but you must ensure uniform, neat and elegant. 6.2.6 disc cabinet within cable shield layer requirements

to prevent the accumulation of air, both ends of the tube are required the Center to bake. 6.2.5 sets should be at the bottom 200mm lashing cable head is fixed rung, with a similar cable color of plastic lashings. Cable head using "equal-width stacked" layout, or according to the size and space within the enclosure cable volume adjust, but you must ensure uniform, neat and elegant. 6.2.6 disc cabinet within cable

你可能感兴趣的:(C语言实验报告指针(二)6)