X
xicloid
I'm trying to write a program that saves numbers without any
duplications.
I was thinking I could start by storing the first number in an array
with size one,
and if the next number is not in the array I've created, I save the
first number and the new input number
in a new array with size two and delete the first array from memory.
This goes on until total of twenty numbers are input into the program.
But is it possible to delete things from memory yourself?
Isn't there anything like garbage collector in C?
duplications.
I was thinking I could start by storing the first number in an array
with size one,
and if the next number is not in the array I've created, I save the
first number and the new input number
in a new array with size two and delete the first array from memory.
This goes on until total of twenty numbers are input into the program.
But is it possible to delete things from memory yourself?
Isn't there anything like garbage collector in C?