PFC-quiz7 - thi trc nghim PFC Quiz7 slot 27 Ghi ch Nhng cu...

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

View Full Document Right Arrow Icon
Đ thi tr c nghi m PFC- Quiz7 - slot 27 Ghi chú: Nh ng câu không ghi đi m đ c hi u là 1 đi m. ượ 7.01. (0.5 đi m) Which of the following accesses a variable var in structure b? b->var; b.var; đúng b-var; b>var; 7.02. (0.5 đi m) Which of the following is a properly defined struct? struct {int a;} struct a_struct {int a;} struct a_struct int a; struct a_struct {int a;}; đúng 7.03. (0.5 đi m) Which properly declares a variable x of struct foo? struct Foo; Foo x; đúng foo; int foo; 7.04. (0.5 đi m) A structure contains a number of data types grouped together. These data types must be of the same type. TRUE FALSE đúng 7.05. What is the output when the sample code below is executed? struct Employee { char name[20]; int age; }; void foo(Employee h) { strcpy(h.name,"Hung"); h.age = 20;
Image of page 1

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

View Full Document Right Arrow Icon
} void display(Employee g) { printf("%s %d ", g.name, g.age); } int main() { Employee t; t = {"Quang",25}; display(t); foo(t); display(t); return 0; } Quang 25 Quang 25 Quang 25 Hung 20 compiler error đúng Hung 20 Hung 20 7.06. (0.5 đi m) Which one of the following is a data type, which can represents
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

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