N
N
Nikita Lubchich2013-11-23 16:59:42
C++ / C#
Nikita Lubchich, 2013-11-23 16:59:42

Why doesn't decrement work?

There is a structure

struct sets{
    int* value;
    int size;
};

There is a call:
...
removeValue(set,value);

Have a function
void removeValue(sets set, int value)
{
...
    set.size--;
}

As a result, the value is not decremented. I think you should specify a pointer to this value, but I can't implement it. How would you check this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dzuba, 2013-11-23
@Cybran

removeValue(&set, value);

void removeValue(sets* set, int value)
{
    ...
    set->size--;
}

M
menkow, 2013-11-23
@menkow

Perhaps passing a parameter by reference will help you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question