Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. int length=sizeof(array1)/sizeof(array1[0]); //For length of array
  2.  
  3. deleteElement(array1,length,4);
  4.  
  5. cout<<"nIn main functionn";
  6.  
  7. for(int i=0;i<length;i++){
  8. cout<<array1[i];
  9. }
  10. return 0;
  11.  
  12. int i=0;
  13.  
  14. for(int i;i<length;i++)
  15. {
  16. if(array2[i]==element)
  17. {
  18. for(int j=i;j<length;j++)
  19. {
  20. array2[j]=array2[j+1];
  21. }
  22. break;
  23. }
  24. }
  25.  
  26. if(i==(length-1)){
  27. cout<<("Element doesn't exist n");
  28. }
  29.  
  30. cout<<"Testing OP in deleteElement n";
  31.  
  32. for(int i=0;i<length;i++){
  33. cout<<array2[i];
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement