1. Homepage
  2. Exam
  3. [2021] CMPSC311 Introduction to Systems Programming - Q4 Pointers

[2021] CMPSC311 Introduction to Systems Programming - Q4 Pointers

This question has been solved
Engage in a Conversation

Question 4 CourseNana.COM

  CourseNana.COM

(5 points) (a) What will the following program print? CourseNana.COM

int main(void) { CourseNana.COM

const char *s = "foo\0bar"; CourseNana.COM

printf("%s\n", s); CourseNana.COM

}      CourseNana.COM

  CourseNana.COM

  CourseNana.COM

(5 points) (b) What is the output of the following program? CourseNana.COM

int main(){ CourseNana.COM

int arr[5] = {10, 20, 23, 59, 90}; CourseNana.COM

int *p1 = &arr[0]; CourseNana.COM

int *p2 = p1 + 3; CourseNana.COM

printf("%d ", *p2); CourseNana.COM

printf("%d ", p2 - p1); CourseNana.COM

return 0; CourseNana.COM

} CourseNana.COM

Get the Solution to This Question

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
Pennsylvania State University代写,PSU代写,Introduction to Systems Programming代写,CMPSC311代写,Pennsylvania State University代编,PSU代编,Introduction to Systems Programming代编,CMPSC311代编,Pennsylvania State University代考,PSU代考,Introduction to Systems Programming代考,CMPSC311代考,Pennsylvania State Universityhelp,PSUhelp,Introduction to Systems Programminghelp,CMPSC311help,Pennsylvania State University作业代写,PSU作业代写,Introduction to Systems Programming作业代写,CMPSC311作业代写,Pennsylvania State University编程代写,PSU编程代写,Introduction to Systems Programming编程代写,CMPSC311编程代写,Pennsylvania State Universityprogramming help,PSUprogramming help,Introduction to Systems Programmingprogramming help,CMPSC311programming help,Pennsylvania State Universityassignment help,PSUassignment help,Introduction to Systems Programmingassignment help,CMPSC311assignment help,Pennsylvania State Universitysolution,PSUsolution,Introduction to Systems Programmingsolution,CMPSC311solution,