Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Sequence point and array
#include <iostream> int* f1(int a[]) { a[3] = 10; return a; } int* f2(int a[100000]) { a[3] = 20; return a; } int* f3(int *a) { a[3] = 30; return a; } int main() { int a[] = {1, 2, 3, 4, 5}; std::cout << "a[]" << std::endl; std::cout << f1(a) << " : "; std::cout << a[3] << std::endl; std::cout << f2(a) << " : " << a[3] << std::endl; std::cout << f3(a) << " : " << a[3] << std::endl; int * pA = new int[5]; for(int i = 0; i < 5; i++) { pA[i] = i + 1; } std::cout << "pA" << std::endl; std::cout << f1(pA) << " : " << pA[3] << std::endl; std::cout << f2(pA) << " : " << pA[3] << std::endl; std::cout << f3(pA) << " : " << pA[3] << std::endl; }
run
|
edit
|
history
|
help
0
Polimorfizm :)
Change a coin with one,two,five coins (print all ways)
threadpool01
CS 201
Abejas beta
reverse function
asa
Array Subset of another array
cppPySlots3
map_find