Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Ptrtest
//g++ 5.4.0 #include <iostream> using namespace std; void pass_by_val(int a) { cout << "pbv: " << a << endl; } void pass_by_ref(int& a) { cout << "pbr: " << a << ":" << &a << endl; } void pass_by_ptr(int* a) { cout << "pbp: " << *a << ":" << a << ":" << &a << endl; } int main() { int locA = 5; int* locPtr = &locA; cout << "locA: " << locA << ":" << &locA << endl; cout << "locPtr: " << *locPtr << ":" << locPtr << ":" << &locPtr << endl << endl; pass_by_val(locA); pass_by_ref(locA); pass_by_ptr(&locA); pass_by_ptr(locPtr); pass_by_ptr((int*)(&locPtr)); }
run
|
edit
|
history
|
help
0
Microsoft - MaxEmployeeAttendence (R repititions - Optimised DP)
runtime template mode processor
string_match
Precendence of Pointer Indirection Example
Program
decode
inversion of array using merge sort
unique_list
template
My First Wall