delete \ Language (API) \ Wiring ALPHA 1.0
Author: Hernando Barragán
Description: Wiring is an electronic sketchbook and hardware electronics for developing ideas. It is a context for learning fundamentals of computer programming and prototyping with electronics within the context of the electronic arts.
Keywords: Wiring, Processing, Interactive Media, Electronic Arts, Programming, C, C++, Hernando Barragán

Search wiring.org.co:

Reference for Wiring version 0023+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name | ### delete
Examples |
    char *speeds = new char[4];  // creates a new char array

    void setup() {
      speeds[0] = 'a';  // set elements of the array
      speeds[1] = 'b';
      speeds[2] = 'c';

      // ...

      delete [] speeds;  // releases the memory allocated for the array, from now on the array can't be used
    }

    void loop() {
      // ...
    }
Description | Deletes or releases the memory allocated for an object with the new oeprator. The keyword delete is typically used similarly to the applications in the above example. In this example, a new array of chars called "speeds" is created, used and then deleted. Operators new and delete can only be used with simple datatypes: int, long or char.
Usage | Application
Related | new

Updated on October 21, 2009 08:29:54pm PDT