current position:Home>It's always displayed in the formal parameter table. What's the mismatch? I'm dizzy, vs2019
It's always displayed in the formal parameter table. What's the mismatch? I'm dizzy, vs2019
2022-02-04 17:13:53 【CSDN Q & A】
// Own general array class #pragma once#include<iostream>using namespace std;template<class T>class MyArray{public: MyArray(int capacity) { cout << "MyArray The parameterized construct of calls " << endl; this->m_Capacity = capacity; this->m_Size = 0; this->pAddress = new T[this->m_Capacity]; } MyArray(const MyArray& arr) { count << "MyArry The copy construct of calls " << endl; this->m_Capacity = arr.m_Capacity; this->m_Size = arr.m_Size; this->pAddress=new T[arr.m_Capacity]; for (int i = 0; i < this->m_Size; i++) { this->pAddress[i] = arr.pAddress[i]; } } MyArray&operator=(const MyArray & arr) { cout << "MyArry Of operator= Call to " << endl; if (this->pAddress != NULL) { delete[] this->pAddress; this->pAddress = NULL; this->m_Capacity = 0; this->m_Size = 0; } this->m_Capacity = arr.m_Capacity; this->m_Size = arr.m_Size; this->pAddress=new T[arr.m_Capacity]; for (int i = 0; i < this->m_Size; i++) { this->pAddress[i] = arr.pAddress[i]; } return *this; } ~MyArray() { if (this->pAddress != NULL) { cout << " Destructor call " << endl; delete[] this->pAddress; this->pAddress = NULL; } }private: T * pAddress;// Pointer to the real array opened by the heap int m_Capacity;// Capacity int m_Size;// size };
Take the answer :
Copy in constructor
this->m_Capacity = arr.m_Capacity;
It doesn't work that way . Member variables are private ,arr.m_Capacity Such access is not allowed . To add get function
copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/02/202202041713520037.html
The sidebar is recommended
- When C + + link list reverses the string, why can my program only output the first two characters?
- The page size of on-demand paging system is 4KB
- Click the jump button in the sub menu of layuimini to jump to the parent page
- Firewalld firewall open port is invalid for specific IP
- springboot + jsonrpc2. 0 request exception, how to return the error to the requester
- Why is the operation different from the expected result ('dish ')
- How does maxcompute realize a high-performance and low latency analysis query for offline data warehouse?
- What is the function of the datahub API mode of maxcompute real-time data on the cloud (synchronization)?
- What SQL supports synchronization in the two-way synchronization between RDS and MySQL?
- What are the permission requirements for database accounts in the two-way synchronization between RDS and MySQL?
guess what you like
-
What is the role of Devops?
-
What is the pod problem when the application deployed on SAE runs?
-
What is the difference between maxcompute's datahub API and logstash?
-
What are the main application scenarios of SaaS model cloud data warehouse + real-time search?
-
What is the development status of Devops?
-
What is the description of source database information configuration in two-way synchronization between RDS and MySQL?
-
What is the description of target database configuration in two-way synchronization between RDS and MySQL?
-
How many steps does maxcompute take to import elasticsearch data?
-
When an application deployed on SAE is running, what is a pending pod?
-
What is the description of task step configuration in two-way synchronization between RDS and MySQL?
Random recommended
- What is the description of the processing mode of the target existing table in the two-way synchronization between RDS and MySQL?
- What are the characteristics of maxcompute data migration and real-time data?
- After importing maxcompute data into elasticsearch, how many steps is the data monitoring divided into?
- Whether to filter DDL configuration in two-way synchronization between RDS and MySQL? What is the description?
- What's the use of a data umbrella?
- What is the description of conflict repair policy configuration in two-way synchronization between RDS and MySQL?
- What are the advantages of maxcompute data migration and real-time data?
- Can large tables and small tables be interchanged in mapjoin?
- What is the description of synchronization object configuration in two-way synchronization between RDS and MySQL?
- When an application deployed on SAE is running, what does a pod that is not ready mean?
- What is the description of the mapping name change configuration in the two-way synchronization between RDS and MySQL?
- What should enterprises do to effectively protect data?
- What are the instructions for filtering the data to be synchronized in the two-way synchronization between RDS and MySQL?
- What is the description of the SQL operation configuration in the two-way synchronization between RDS and MySQL?
- What are the responsibilities of Devops engineers?
- How many modules is maxcompute's data cloud task development divided into?
- What are the instructions for setting alarm configuration in two-way synchronization between RDS and MySQL?
- What are the concerns of Devops?
- What are the features of maxcompute's data cloud task development data source configuration module?
- What is the description of the target database object name case policy configuration in the two-way synchronization between RDS and MySQL?
- How does the nailing applet realize the function of tab
- At present, does SAE support automatic volume expansion and shrinkage, and does SAE have an API for volume expansion and shrinkage?
- In the two-way synchronization between RDS and MYSQL, what is the description of the retry time configuration after the source database and target database cannot be connected?
- What are the features of maxcompute's data cloud task development script mode task development module?
- What are the steps to develop the operation and maintenance experience of serverless?
- What are the characteristics of the task development module of maxcompute's data cloud task development Wizard mode?
- What are the characteristics of maxcompute's data cloud task development task scheduling attribute configuration module?
- What is the role of serverless application engine (SAE)?
- What source databases are supported by RDS MySQL synchronization to polardb MySQL Cluster?
- What is project protection?
- What are the prerequisites for synchronizing RDS Mysql to polardb MySQL Cluster?
- Use of spring security in distributed architecture
- Java process control
- Introduction to the mechanical arm of logistics trolley
- On the operation of C language
- How to run this GitHub app with vscode Java this file?
- Why does this always happen?
- Write a java program to define the book class
- On Linux file output, how to display files one paragraph at a time
- C language OJ questions, please inform