Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int *array1=new int [3];
- void My_function()
- {
- My_set(array1);
- for(int i=0;i<3;i++){ //The output is 5 15 55
- cout<<array1[i]<<endl;
- }
- Display (array1)
- }
- void My_set(int *array1)
- {
- array1[0]=5;
- array1[1]=15;
- array1[2]=55;
- }
- void Display(int *array1){
- for(int i=0;i<3;i++){
- cout<<array1[i]<<endl; //The output is Garbage -842150451
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement