SlideShare a Scribd company logo
1 of 1
Download to read offline
C++ Suppose a String class has the following definition and a main which uses it: a) Write a one
argument constructor for the String class, with a char * as the argument, This function first
allocates 80 characters from the heap using new and points str to it, then copies the argument to
that memory, and assigns len the length of the string. (5 points) b) Write a destructor for String
that cleans up the allocated memory. (5 points) c) Write the operator assignment to assign one
String into another (5 points)

More Related Content

More from sels6

CalculateCurrent RatioQuick RatioAccounts Receivable Turnover.pdf
CalculateCurrent RatioQuick RatioAccounts Receivable Turnover.pdfCalculateCurrent RatioQuick RatioAccounts Receivable Turnover.pdf
CalculateCurrent RatioQuick RatioAccounts Receivable Turnover.pdfsels6
 
Complete the method count which should be a wrapper method that call.pdf
Complete the method count which should be a wrapper method that call.pdfComplete the method count which should be a wrapper method that call.pdf
Complete the method count which should be a wrapper method that call.pdfsels6
 
calculate calculate calculate calculate 1. The jo.pdf
calculate calculate calculate calculate  1. The jo.pdfcalculate calculate calculate calculate  1. The jo.pdf
calculate calculate calculate calculate 1. The jo.pdfsels6
 
Compare la bomba de sodiopotasio con la prote�na en forma de barril.pdf
Compare la bomba de sodiopotasio con la prote�na en forma de barril.pdfCompare la bomba de sodiopotasio con la prote�na en forma de barril.pdf
Compare la bomba de sodiopotasio con la prote�na en forma de barril.pdfsels6
 
Companies U and L are identical in every respect except that U is un.pdf
Companies U and L are identical in every respect except that U is un.pdfCompanies U and L are identical in every respect except that U is un.pdf
Companies U and L are identical in every respect except that U is un.pdfsels6
 
Cadena de valor y clasificaci�n de costes, empresa inform�tica. Dell.pdf
Cadena de valor y clasificaci�n de costes, empresa inform�tica. Dell.pdfCadena de valor y clasificaci�n de costes, empresa inform�tica. Dell.pdf
Cadena de valor y clasificaci�n de costes, empresa inform�tica. Dell.pdfsels6
 
Comment about this post.Motivators to help employees at the workpl.pdf
Comment about this post.Motivators to help employees at the workpl.pdfComment about this post.Motivators to help employees at the workpl.pdf
Comment about this post.Motivators to help employees at the workpl.pdfsels6
 
Comment about this post.Some of the best motivators for employee.pdf
Comment about this post.Some of the best motivators for employee.pdfComment about this post.Some of the best motivators for employee.pdf
Comment about this post.Some of the best motivators for employee.pdfsels6
 
Co-evolutionary troubles at the Renault Nissan alliance Widely hai.pdf
Co-evolutionary troubles at the Renault Nissan alliance Widely hai.pdfCo-evolutionary troubles at the Renault Nissan alliance Widely hai.pdf
Co-evolutionary troubles at the Renault Nissan alliance Widely hai.pdfsels6
 
Clasifique los siguientes rasgos como espec�ficos de c�lulas o virus.pdf
Clasifique los siguientes rasgos como espec�ficos de c�lulas o virus.pdfClasifique los siguientes rasgos como espec�ficos de c�lulas o virus.pdf
Clasifique los siguientes rasgos como espec�ficos de c�lulas o virus.pdfsels6
 
C2-1 (State of California�Fund Identification) The following list in.pdf
C2-1 (State of California�Fund Identification) The following list in.pdfC2-1 (State of California�Fund Identification) The following list in.pdf
C2-1 (State of California�Fund Identification) The following list in.pdfsels6
 
Clara est� demandando a David por una disputa de propiedad. Clara y .pdf
Clara est� demandando a David por una disputa de propiedad. Clara y .pdfClara est� demandando a David por una disputa de propiedad. Clara y .pdf
Clara est� demandando a David por una disputa de propiedad. Clara y .pdfsels6
 
Childhood participation in sports, cultural groups, and youth groups.pdf
Childhood participation in sports, cultural groups, and youth groups.pdfChildhood participation in sports, cultural groups, and youth groups.pdf
Childhood participation in sports, cultural groups, and youth groups.pdfsels6
 
Chapter 24 AuditingQuestion 3 Amira Nadim, an auditor, has prepar.pdf
Chapter 24 AuditingQuestion 3 Amira Nadim, an auditor, has prepar.pdfChapter 24 AuditingQuestion 3 Amira Nadim, an auditor, has prepar.pdf
Chapter 24 AuditingQuestion 3 Amira Nadim, an auditor, has prepar.pdfsels6
 
Chapter 7 Problems7.1 Match each term with its definition.1. .pdf
Chapter 7 Problems7.1 Match each term with its definition.1. .pdfChapter 7 Problems7.1 Match each term with its definition.1. .pdf
Chapter 7 Problems7.1 Match each term with its definition.1. .pdfsels6
 
Changes in Current Operating Assets and Liabilities Covington Corpor.pdf
Changes in Current Operating Assets and Liabilities Covington Corpor.pdfChanges in Current Operating Assets and Liabilities Covington Corpor.pdf
Changes in Current Operating Assets and Liabilities Covington Corpor.pdfsels6
 
Chapter 13 Case StudyUsing the information that follows for Cedar .pdf
Chapter 13 Case StudyUsing the information that follows for Cedar .pdfChapter 13 Case StudyUsing the information that follows for Cedar .pdf
Chapter 13 Case StudyUsing the information that follows for Cedar .pdfsels6
 
CGV MCQ 1. The objectives of good corporate governance by adhering t.pdf
CGV MCQ 1. The objectives of good corporate governance by adhering t.pdfCGV MCQ 1. The objectives of good corporate governance by adhering t.pdf
CGV MCQ 1. The objectives of good corporate governance by adhering t.pdfsels6
 
CCM A hypothetical company called Infrastructure4Sure provides In.pdf
CCM A hypothetical company called Infrastructure4Sure provides In.pdfCCM A hypothetical company called Infrastructure4Sure provides In.pdf
CCM A hypothetical company called Infrastructure4Sure provides In.pdfsels6
 
Caterpillar Inc. sufri� una ca�da significativa en las ganancias lue.pdf
Caterpillar Inc. sufri� una ca�da significativa en las ganancias lue.pdfCaterpillar Inc. sufri� una ca�da significativa en las ganancias lue.pdf
Caterpillar Inc. sufri� una ca�da significativa en las ganancias lue.pdfsels6
 

More from sels6 (20)

CalculateCurrent RatioQuick RatioAccounts Receivable Turnover.pdf
CalculateCurrent RatioQuick RatioAccounts Receivable Turnover.pdfCalculateCurrent RatioQuick RatioAccounts Receivable Turnover.pdf
CalculateCurrent RatioQuick RatioAccounts Receivable Turnover.pdf
 
Complete the method count which should be a wrapper method that call.pdf
Complete the method count which should be a wrapper method that call.pdfComplete the method count which should be a wrapper method that call.pdf
Complete the method count which should be a wrapper method that call.pdf
 
calculate calculate calculate calculate 1. The jo.pdf
calculate calculate calculate calculate  1. The jo.pdfcalculate calculate calculate calculate  1. The jo.pdf
calculate calculate calculate calculate 1. The jo.pdf
 
Compare la bomba de sodiopotasio con la prote�na en forma de barril.pdf
Compare la bomba de sodiopotasio con la prote�na en forma de barril.pdfCompare la bomba de sodiopotasio con la prote�na en forma de barril.pdf
Compare la bomba de sodiopotasio con la prote�na en forma de barril.pdf
 
Companies U and L are identical in every respect except that U is un.pdf
Companies U and L are identical in every respect except that U is un.pdfCompanies U and L are identical in every respect except that U is un.pdf
Companies U and L are identical in every respect except that U is un.pdf
 
Cadena de valor y clasificaci�n de costes, empresa inform�tica. Dell.pdf
Cadena de valor y clasificaci�n de costes, empresa inform�tica. Dell.pdfCadena de valor y clasificaci�n de costes, empresa inform�tica. Dell.pdf
Cadena de valor y clasificaci�n de costes, empresa inform�tica. Dell.pdf
 
Comment about this post.Motivators to help employees at the workpl.pdf
Comment about this post.Motivators to help employees at the workpl.pdfComment about this post.Motivators to help employees at the workpl.pdf
Comment about this post.Motivators to help employees at the workpl.pdf
 
Comment about this post.Some of the best motivators for employee.pdf
Comment about this post.Some of the best motivators for employee.pdfComment about this post.Some of the best motivators for employee.pdf
Comment about this post.Some of the best motivators for employee.pdf
 
Co-evolutionary troubles at the Renault Nissan alliance Widely hai.pdf
Co-evolutionary troubles at the Renault Nissan alliance Widely hai.pdfCo-evolutionary troubles at the Renault Nissan alliance Widely hai.pdf
Co-evolutionary troubles at the Renault Nissan alliance Widely hai.pdf
 
Clasifique los siguientes rasgos como espec�ficos de c�lulas o virus.pdf
Clasifique los siguientes rasgos como espec�ficos de c�lulas o virus.pdfClasifique los siguientes rasgos como espec�ficos de c�lulas o virus.pdf
Clasifique los siguientes rasgos como espec�ficos de c�lulas o virus.pdf
 
C2-1 (State of California�Fund Identification) The following list in.pdf
C2-1 (State of California�Fund Identification) The following list in.pdfC2-1 (State of California�Fund Identification) The following list in.pdf
C2-1 (State of California�Fund Identification) The following list in.pdf
 
Clara est� demandando a David por una disputa de propiedad. Clara y .pdf
Clara est� demandando a David por una disputa de propiedad. Clara y .pdfClara est� demandando a David por una disputa de propiedad. Clara y .pdf
Clara est� demandando a David por una disputa de propiedad. Clara y .pdf
 
Childhood participation in sports, cultural groups, and youth groups.pdf
Childhood participation in sports, cultural groups, and youth groups.pdfChildhood participation in sports, cultural groups, and youth groups.pdf
Childhood participation in sports, cultural groups, and youth groups.pdf
 
Chapter 24 AuditingQuestion 3 Amira Nadim, an auditor, has prepar.pdf
Chapter 24 AuditingQuestion 3 Amira Nadim, an auditor, has prepar.pdfChapter 24 AuditingQuestion 3 Amira Nadim, an auditor, has prepar.pdf
Chapter 24 AuditingQuestion 3 Amira Nadim, an auditor, has prepar.pdf
 
Chapter 7 Problems7.1 Match each term with its definition.1. .pdf
Chapter 7 Problems7.1 Match each term with its definition.1. .pdfChapter 7 Problems7.1 Match each term with its definition.1. .pdf
Chapter 7 Problems7.1 Match each term with its definition.1. .pdf
 
Changes in Current Operating Assets and Liabilities Covington Corpor.pdf
Changes in Current Operating Assets and Liabilities Covington Corpor.pdfChanges in Current Operating Assets and Liabilities Covington Corpor.pdf
Changes in Current Operating Assets and Liabilities Covington Corpor.pdf
 
Chapter 13 Case StudyUsing the information that follows for Cedar .pdf
Chapter 13 Case StudyUsing the information that follows for Cedar .pdfChapter 13 Case StudyUsing the information that follows for Cedar .pdf
Chapter 13 Case StudyUsing the information that follows for Cedar .pdf
 
CGV MCQ 1. The objectives of good corporate governance by adhering t.pdf
CGV MCQ 1. The objectives of good corporate governance by adhering t.pdfCGV MCQ 1. The objectives of good corporate governance by adhering t.pdf
CGV MCQ 1. The objectives of good corporate governance by adhering t.pdf
 
CCM A hypothetical company called Infrastructure4Sure provides In.pdf
CCM A hypothetical company called Infrastructure4Sure provides In.pdfCCM A hypothetical company called Infrastructure4Sure provides In.pdf
CCM A hypothetical company called Infrastructure4Sure provides In.pdf
 
Caterpillar Inc. sufri� una ca�da significativa en las ganancias lue.pdf
Caterpillar Inc. sufri� una ca�da significativa en las ganancias lue.pdfCaterpillar Inc. sufri� una ca�da significativa en las ganancias lue.pdf
Caterpillar Inc. sufri� una ca�da significativa en las ganancias lue.pdf
 

Recently uploaded

Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 

Recently uploaded (20)

Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 

C++ Suppose a String class has the following definition and a main w.pdf

  • 1. C++ Suppose a String class has the following definition and a main which uses it: a) Write a one argument constructor for the String class, with a char * as the argument, This function first allocates 80 characters from the heap using new and points str to it, then copies the argument to that memory, and assigns len the length of the string. (5 points) b) Write a destructor for String that cleans up the allocated memory. (5 points) c) Write the operator assignment to assign one String into another (5 points)