add pointer in classes
add interfaces
This commit is contained in:
@@ -65,5 +65,19 @@ int main()
|
||||
shared_ptr<int> pTmpSharedPointer2 = pNumber7.lock();
|
||||
if (pTmpSharedPointer2 != nullptr) *pTmpSharedPointer2 = 10; // smart pointer are no guarantee for a valid object behind the pointer
|
||||
|
||||
// const exercise
|
||||
// int *
|
||||
// const int *
|
||||
// int const *
|
||||
// int * const
|
||||
// const int * const
|
||||
// int const * const
|
||||
// const int const * const
|
||||
// const int const const * const
|
||||
|
||||
// const int* pNumber = new int(0);
|
||||
// *pNumber = 10; // is this working
|
||||
// pNumber = new int(0); // is this working
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user