1. Trang chủ
  2. » Giáo Dục - Đào Tạo

Bài tập Kỹ thuật vi xử lý - DTVT - BKDN (bài09)

3 10 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Bài tập Kỹ thuật vi xử lý - DTVT - BKDN

Homework #9 Functions (Ch 15) and Pointers and Arrays (Ch 16) In order to automate the grading process, please follow the exact instructions for each questions and don’t use extra or unnecessary words (5 points) What is the output of the program below? void MyFunc(int z); int main() { int z = 4; MyFunc(z); MyFunc(z); } void MyFunc(int z) { printf ("%d ", z); z++; } Answer : (5 points) What is the output of the following program? int x = 0; int main() { int *px = &x; int x = 10; *px = 20; printf("x = %d\n", x); } Answer : (5 points) The following code segment has three declared variables, namely a, b, and c Which of these variables is equivalent to the expression &b[0] ? int main() { int a; int *b; int **c; b=&a; c=&b; } Answer : (5 points) A 10 element character array is defined in MSP430 assembly code as follows: BYU, ECEn/CS 124 Homework #9 Page 1/3 .bss hold,10 text mov #hold,r12 ????????? Replace the ???????? with ONE assembly line of code to perform the following C statement: hold[5] = 13; Answer : (6 points) In the following piece of code, the variable argv is an array of the command line arguments passed to the function main int main(int argc, char* argv[]) { int i; for (i=0;i

Ngày đăng: 06/09/2021, 17:29

Xem thêm:

TỪ KHÓA LIÊN QUAN

w