I want to set the an element of a dynamic array to nullptr ,but i get an error.
#include <iostream>
#include <vector>
using namespace std;
class Site {
//a class called site
public:
int i{};
};
int main() {
Site* p = new Site[10];
p[0].i = 5;
delete [0] p;
p[0]=nullptr;
}
I keep on getting the error,"no operator "=" matches these operands"
I tried searching on google but i couldn't find what i was looking for.