HES1300 Lab 7 - Swinburne University of Technology(Sarawak...

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

Swinburne University of Technology (Sarawak Campus) Faculty of Engineering, Computing and Science Semester 2, 2014 HES1300 Robotics & Mechatronics Project 1 (C Programming) Lab 7 - Pointers Task 1 1. Declare integers data1 and data2 . 2. Declare an integer pointer ptr1 and initialize with the address of data1 . 3. Declare another integer pointer ptr2 . 4. Assign a value of 100 to data1. 5. Assign the address of data2 to ptr2 . 6. Assign a value of 1000 to data2 by dereferencing . 7. Print the value and address of data1 and data2 by using pointer as shown. Data 1 Value: <value of data1 > Address: <address of data1 > Data 2 Value: <value of data2 > Address: <address of data2 > Task 2 1. Declare an integer time . 2. Declare double velocity_1 & velocity_2 . 3. Declare a character mychar . 4. Declare an integer pointer iptr and initialize with the address of time . 5. Declare a double pointer dptr. 6. Declare a character pointer cptr. 7. Assign a value of 10 to time . 8. Assign the address of velocity_1 to dptr .
Image of page 1

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

Image of page 2
This is the end of the preview. Sign up to access the rest of the document.
  • Fall '14

{[ 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