i want to remove 0 from an integer array.like if i have an array having element 2 2 1 1 1 0 1 1 2 1 0 1 ,i want this as
2 2 1 1 1 1 1 2 1 1,plz help me
sony1988.sc
0
Newbie Poster
Recommended Answers
Jump to Postif you are limited to using the premitive type of int as an array then you can do it this way:
1. loop through the array
2. if 0 is found then "shuffle" the preceeding elements by replacing the "0" element with the next element (if not zero).
3. …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.