What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-03-14 07:05:04
constant variables in c++
// various versions of const are explained below #include <iostream> class Entity { private: int m_X, m_Y; mutable int var; // can be modified inside const menthods int* m_x, *m_y;// * use to create pointer in one line public: int GetX() const /... Add solution -
C 2022-02-17 02:10:05
callback c++ c
//Define a type for the callback signature, //it is not necessary, but makes life easier //Function pointer called CallbackType that takes a float //and returns an int typedef int (*CallbackType)(float); void DoWork(CallbackType callback) { float v... Add solution -
C++ 2022-02-02 21:51:57
pointer in cpp details
Every object in C++ has access to its own address through an important pointer called this pointer. The this pointer is an implicit parameter to all member functions. Therefore, inside a member function, this may be used to refer to the invoking object... Add solution -
C++ 2021-10-14 12:41:11
this in c++
Every object in C++ has access to its own address through an important pointer called this pointer. The this pointer is an implicit parameter to all member functions. Therefore, inside a member function, this may be used to refer to the invoking object. ... Add solution -
C++ 2021-10-11 10:32:05
const in c++
// various versions of const are explained below #include <iostream> class Entity { private: int m_X, m_Y; mutable int var; // can be modified inside const menthods int* m_x, *m_y;// * use to create pointer in one line public: int GetX() const /... Add solution -
C++ 2021-10-07 19:31:05
what is this pointer in c++
Every object in C++ has access to its own address through an important pointer called this pointer. The this pointer is an implicit parameter to all member functions. Therefore, inside a member function, this may be used to refer to the invoking object. ... Add solution -
C++ 2021-09-27 21:28:04
void pointer
// A void pointer is a generic pointer, it has no associated type with it. // A void pointer can hold address of any type and can be typcasted to any type. void *ptr; ///// Examples void *v; int *i; int ivar; char chvar; float fvar; v = &ivar; //... Add solution -
C++ 2021-09-10 07:20:02
c pointers vs references
Pointers: A pointer is a variable that holds memory address of another variable. A pointer needs to be dereferenced with * operator to access the memory location it points to. References : A reference variable is an alias, that is, another name for an al... Add solution -
C++ 2021-08-30 04:05:03
const c++
// various versions of const are explained below #include <iostream> class Entity { private: int m_X, m_Y; mutable int var; // can be modified inside const menthods int* m_x, *m_y;// * use to create pointer in one line public: int GetX() const /... Add solution -
C++ 2021-08-27 11:16:01
What is This pointer? Explain with an Example.
Every object in C++ has access to its own address through an important pointer called this pointer. The this pointer is an implicit parameter to all member functions. Therefore, inside a member function, this may be used to refer to the invoking object. ... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5