This tag refers to the process of removing or deleting data, text, files, or memory.
Questions tagged [erase]
739 questions
3
votes
3 answers
AS3 How to check if BitmapData is empty
I have a code to erase a masked movieclip. (credits here)
I would like to know how I can check if the whole movieclip is been erased.
So I thought I had to check if the BitmapData is empty, but I could be terribly wrong!
How can I check if every…

Opoe
- 1,337
- 8
- 30
- 56
3
votes
2 answers
Scanf erases a char array unwillingly
See the following program:
#include
#include
#include
#include
main(void){
printf("Array concatenateor\n-------------------------\n");
//declarations
char s1[50],s2[50],s3[50];
short int n=0;
…

andreihondrari
- 5,743
- 5
- 30
- 59
3
votes
3 answers
How do I use std:vector's erase() function properly?
I am having a strange issue when using the erase() function on a std:vector. I use the following code:
int count = 0;
for (int itr=0; itr

Mike N.
- 358
- 7
- 20
3
votes
1 answer
Erase using iterator on C++ map
I am experiencing the following behavior: I create a map, do a find on the key and delete the map entry. After erase, I print the elements using the iterator and I expected it to dump core but it works.
Why does it work?
typedef…

Winjun
- 31
- 1
3
votes
1 answer
how to erase a thread after joined it?
Multithreading program in c++, the problem is:
i have a vector of threads, where i push_back every thread i create, and i want to make a kind of "steal-work scheduling", in such a way that when a thread is joined, so i assume his job is terminated,…

GiovanniSan
- 99
- 7
3
votes
1 answer
Display cursor line in place of erased character when iText erase in fabric js
I am using fabric js version 1.7.22
I am working on one project in which I need to add text and it's editing.
When I add new iText in canvas and write some text and erase it. It shows me old cursor line in place of erased character,
I Can't generate…

Mayur Kukadiya
- 2,461
- 1
- 25
- 58
3
votes
1 answer
Remove only one item from unordered_multiset
I want to erase a specific element from std::unordered_multiset, but when I try with erase function, it eliminates all the items, no matter how many they are.
For example:
std::unordered_multiset…

Eduard Rostomyan
- 7,050
- 2
- 37
- 76
3
votes
1 answer
Removing a pair from a vector of pairs
I have a vector of pairs
std::vector lambda;
I would like to remove the kth element, i.e
lambda.erase(&lambda[k]);
lambda.erase(lambda[k]);
Both of these attempts throws a no matching function call error:
error: no matching function…
user9833551
3
votes
1 answer
Secure Delete of eMMC Card (BLKSECDISCARD returns EOPNOTSUPP)
I need to securely erase an MMC card in an embedded system. However, my ioctl(BLKSECDISCARD) returns EOPNOTSUPP, (as does BLKDISCARD).
By reading kernel code, the MMC driver enables DISCARD by setting QUEUE_FLAG_DISCARD in…

Matt Muggeridge
- 465
- 3
- 11
3
votes
6 answers
Why is erase() function so expensive?
Consider a 2d vector vector < vector > Nand lets say its contents are as follows:
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
So the size of N here is 4 i.e. N.size() = 4
Now, consider the following code :
int i = 0;
while(N !=…

0x0
- 2,915
- 5
- 40
- 67
3
votes
5 answers
How do I pass a "const_reverse_iterator" parameter to "std::vector::erase()"?
std::vector::erase() does not accept reverse iterator.
Is there any way to call this method with a reverse iterator?
My sample code is:
std::vector MyVector;
for (int i=0; i<10; i++)
{
MyVector.push_back(i);
}
// Now suppose that I want to…

hkBattousai
- 10,583
- 18
- 76
- 124
3
votes
2 answers
Erasing a container element using iterators
My current homework assignment has me creating an iterator class for a list. I'm stuck at creating a good erase(iterator where) function.
Current code (reduced to fit question):
class List
{
class _Iter
{
friend class List;
…

IAE
- 2,213
- 13
- 37
- 71
3
votes
3 answers
PHP script to remove dot files from Linux directory
I have been working on a project that involves a step, during which the script needs to automatically remove a certain directory in Linux ( and all its contents ).
I am currently using the following code to do that:
# Perform a recursive removal of…

Peter
- 51
- 7
3
votes
3 answers
Prevent vector items from being moved
this is a learning question for me and hopefully others as well. My problem breaks down to having a pointer pointing to content of a vector. The issue occurs when I erase the first element of the vector. I'm not quite sure what I was expecting, I…

ruhig brauner
- 943
- 1
- 13
- 35
3
votes
1 answer
OpenMP parallelization and deleting from a vector of lists
gang. First, a high-level description of the problem & approach.
I have a list containing images and pixel locations in each image - a list of lists. I want to pick n items at random from that list of images and for each image I want to iterate over…

autonomy
- 1,165
- 1
- 12
- 18