Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int * fun(int* a, int n){
- int result[n];
- for (int i = 0; i < n; i++){
- result[i] = 2*a[i];
- }
- return result;
- }
- int main(){
- int a[10];
- for(int i = 0; i < 10; i++){
- a[i] = i;
- }
- int *b = fun(a, 10);
- for (int i = 0; i < 10; i++){
- cout << b[i] << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement