Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

solve the error is code please code must display : 5 5.5 this Displaying an object of type Vector in a different way: 5 5.5

solve the error is code please

image text in transcribed

code must display :

5 5.5 this

Displaying an object of type Vector in a different way:

5

5.5

this

CODE:

#include using namespace std; template class Vector { T* arr; int maximum; int index; public: Vector() { arr = new T[1]; maximum = 1; index = 0; } void add(T data) { if (index == maximum) { T* temp = new T[2 * maximum]; for (int i = 0; i v; Vector v1; Vector v2; v.add(5); v1.add(5.5); v2.add("this"); for (int i = 0; i

NOTE : PLEASE FIX IT THIS MY LAST Question in THIS SUBSCRIBETION.

Exception Thrown X Exception thrown at 0x79CDF3BE (ucrtbased.dll) in Project44.exe: Oxc0000005: Access violation reading location Ox00500000. Value 0 {arr=0x00845198 {5.50000000} maximum=1 index=1 } {arr=0x0084f73c "this" maximum=1 index=1 } Copy Details Start Live Share session... Exception Settings Break when this exception type is thrown Except when thrown from: ucrtbased.dll Open Exception Settings Edit Conditions

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions