Fall08-Final-Handout

Fall08-Final-Handout - CS 241 THE UNIVERSITY OF NEW MEXICO...

Info icon This preview shows pages 1–4. Sign up to view the full content.

CS 241 THE UNIVERSITY OF NEW MEXICO Final Exam – Tuesday, December 11, 10:00am-12:00pm, 2007 COMPUTER SCIENCE Data Organization (Time allowed: 120 minutes) LASTNAME: FIRSTNAME: STUDENT ID NUMBER: SECTION LEADER NAME: Answer all questions in the space provided. Write clearly and legibly, you will not get credit for illegible answers. This is a closed book, closed notes exam. No other aids are allowed. Print your name at the top of every page. 1 circlecopyrt 25 2 circlecopyrt 25 3 circlecopyrt 25 4 circlecopyrt 25 Total 100
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Student Name: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 circlecopyrt Short answer questions [25 points] A) What are four of the ”primitive“ data types in C? [2 points] B) What are four of the bit-wise operators in C? [2 points] C) What’s the difference between x++ and ++x ? Examples please! [2 points] D) for(i=0,j=0;i<5;i++,j=i+j); What are i and j after this loop? [2 points] E) Please list two preprocessor commands with examples! [2 points] F) What compiler flag is used for debugging? Name one debugger we’ve used. [2 points] – 2 – CS 241
Image of page 2
Student Name: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G) How do you declare a pointer to an array of strings in C? [2 points] H) Using pointer arithmetic, get the 3rd char in the 5th string from the above array. [2 points] I) typedef struct _Person { char name[24]; int age; } Person; How much memory does the array: Person arr[10]; take up? [2 points] J) What is it that controls what commands a makefile will perform? [2 points] K) How do you create a pointer to a variable declared as extern int value; ? [2 points] L) Do the following two statements cause an error when executed in order? Please explain!
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Image of page 4
This is the end of the preview. Sign up to access the rest of the document.
  • Fall '08
  • Lesnik
  • Pointer, memory allocator

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern