Horje
pointers in c++ Code Example
c++ fonksion pointer
#include <stdio.h>
int f1(int x) { return x * 2; }
int f2(int x) { return x * 4; }

int main()
{
    int (*fptr1)(int) = &f1;
    fptr1 = &f2;
  	fptr1(3);
}
pointers in c++
void simple_pointer_examples() {
    int   a;  // a can contain an integer
	int*  x;  // x can contain the memory address of an integer. 
 	char* y;  // y can contain the memory address of a char. 
 	Foo*  z;  // z can contain the memory address of a Foo object.  
 
    a = 10;
    x = &a;   // '&a' extracts address of a 
  
    std::cout <<  x << std::endl; // memory address of a => 0x7ffe9e25bffc
    std::cout << *x << std::endl; //          value of a => 10
}
pointers c++
baz = *foo;




Cpp

Related
move elements from vector to unordered_set Code Example move elements from vector to unordered_set Code Example
how to delete an element in vector pair in cpp Code Example how to delete an element in vector pair in cpp Code Example
c++ function of find maximum value in an array Code Example c++ function of find maximum value in an array Code Example
How to turn an integer variable into a char c++ Code Example How to turn an integer variable into a char c++ Code Example
cmake g++ address sanitizer Code Example cmake g++ address sanitizer Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11