Knowee
Questions
Features
Study Tools

class Person {public: int id_; Person* friends_; int num_friends_;};Außerdem sei folgende Speicherbelegung gegeben:Adresse ... 1  2  3  4  5  6  7  8 9 10 11 12 13 14 15 16 ...Wert ... 7 251111141421505210

Question

class Person {public: int id_; Person* friends_; int num_friends_;};Außerdem sei folgende Speicherbelegung gegeben:Adresse ... 1  2  3  4  5  6  7  8 9 10 11 12 13 14 15 16 ...Wert ... 7 251111141421505210

🧐 Not the exact question you are looking for?Go ask a question

Solution

Es scheint, dass Sie eine Frage zur Speicherbelegung einer Klasse in C++ haben, aber Ihre Frage ist nicht vollständig. Die Klasse Person hat drei Mitglieder: id_, friends_ und num_friends_.

Die Speicherbelegung, die Sie gegeben haben, scheint eine Reihe von Adressen und Werten zu sein, aber es ist nicht klar, wie diese Werte den Mitgliedern der Person-Klasse zugeordnet sind.

Könnten Sie bitte Ihre Frage klären? Was genau möchten Sie wissen?

This problem has been solved

Similar Questions

If the line:friend class A;appears in class B, and the line:friend class B;appears in class C, then:a.Class A is a friend of class C.b.Class A can access private variables of class B.c.Class C can call class A’s private member functions.d.Class B can access class A’s private variables.

class Student:    def __init__(self,name,id):        self.name=name        self.id=id        print(self.id)std=Student("Simon",1)std.id=2print(std.id)

Write a C++ Program and Subsequent Pseudo Code to print the student details applied for VITEE Examinations. Define a Class STUDENT, with required  Private Data members to store the information about a student. Now define atlease one nonmember function as a friend  to a class STUDENT either  to read or print the student details.Input : Student_No, Student_Name, Student_Age, Student_Sex, Student_Plus12Marks, Student_Address, Student_MobleNo.Output : Student_No, Student_Name, Student_Age, Student_Sex, Student_Plus12Marks, Student_Address, Student_MobleNo, Eligible/Not EligibleNote : Student_Name Contains F_Name, M_Name, L_Name; and if Student_Plus12Makrs is > 800 then Print "Eligible" otherwise print "Not Eligible"

Design a class named Person and its two subclasses named Student and Employee.  Make Faculty and Staff subclasses of Employee. A person has a name,  address, phone_number, and e-mail address. A student has a status (freshman, sophomore, junior, or senior).  An employee  has an office, salary. A faculty member has office_hours and a rank. A staff member has a title. Override the toString() method in each of these classes to display their details. Write a Java application and subsequent pseudocode to implement/simulate the same.

class Student:      def __init__(self,name,id):               self.name = name               self.id = id               print(self.id, end=" ")std1=Student("Mark",1)std2=Student("May",2)std2.id=2print(std2.id, end=" ")

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.