Category : pointers

The code shows an invalid conversion from int to *int how do I fix the problem … the full detail of error is given below : Code: #include <iostream> using namespace std; bool isSafe(int** arr[], int x, int y, int n) { if (x > n && y > n && arr[x][y] == 1) { ..

Read more

I got this error "munmap_chunk(): invalid pointer Aborted" when I using qsort() to sort a array that contains class objects. Here is my code: #include <iostream> #include <string> #include <cstdlib> class MyString : public string { public: MyString(const char *str) :string(str) {} MyString(const string & str) :string(str) {} }; int CompareString(const void * e1, const ..

Read more