Lab7 Pointers
OBJECTIVES
After completing this experiment, you will be able to:
Understand pointers fundamentals
Understand functions and pointers
Pass arrays to functions
Use pointers to One-Dimensional Arrays
PROCEDURES
1. What format speci ers (in order) should be used in the printf() statement in the following program? Note that in the program the correct format speci ers have been replaced by Z.
#include <stdio.h>
int main(void)
{
int x = 5;
int *x_ptr = &x;
printf("%Z, %Z, %Z, %Z\n", x, *x_ptr, &x, x_ptr);
}
Your answers:(2 Marks)
%d,%d,%p,%p
——————————————————

Print Screen of Result: (3 Marks)
2. On a machine in which addresses are 2 bytes, what is printed by the following program: #include <stdio.h>
大连东软信息学院大一上 电子工程 c语言-实验_第三次,第六周_工学_高等教育_教育专区。Lab 3 Conditions OBJECTIVES After completing this experiment, you will...
大连东软信息学院大一上 电子工程 c语言-实验第五次,第十周_工学_高等教育_教育专区。Lab5 Structured Programming OBJECTIVES After completing this experiment, ...
大连东软信息学院大一上 电子工程c语言-实验第四次,第八周_工学_高等教育_教育专区。Lab4 Looping Structures OBJECTIVES After completing this experiment, you ...
大连东软信息学院大一上 电子工程 c语言-实验.doc第一次,第二周_工学_高等...,error6.c in directory “error1-6” to the default path of TurboC, ...
暂无评价0人阅读0次下载举报文档 大连东软信息学院大一上 电子工程 c语言 实验第七次,第十四周_工学_高等教育_教育专区。Lab8 Data Structures OBJECTIVES ...
大连东软信息学院大一上 电子工程 c语言-作业_第三次,第六周_工学_高等教育_教育专区。1.Build a number guessing game that uses input validation to verify...
大连东软信息学院大一上 电子工程 c语言-作业第四次,第八周_工学_高等教育_教育专区。1. Create a counting program that counts from 1 to 100 in ...
大连东软信息学院大一上 电子工程 c语言-作业_第2次,第四周_工学_高等教育_教育专区。1. Given a=5,b=1,x=10,and y=5,create a program that outputs ...
大连东软信息学院大一上 电子工程 c语言-作业.doc第一次,第二周_工学_高等...("1\t2\t3\t4\t5\t6\t7\n"); printf("8\t9\t10\t11\t12\t\...
大连东软信息学院专业介... 12页 免费喜欢此文档...(第1学期48学时,第2学期64学时) 周学时:6学时 ...软件工程 操作系统 C语言 C语言起源及特点 C语言在...
热门文档