Changes between Version 25 and Version 26 of ResumedC


Ignore:
Timestamp:
May 26, 2009, 3:21:14 PM (15 years ago)
Author:
Thanatermesis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ResumedC

    v25 v26  
    112112
    113113
     114==== Void ====
     115 * In a function declaration means that the function returns no value
     116 * When used in a pointer declaration (called ''pointer to void''), void defines a generic pointer, so it returns an address, it is commonly used when a function is called with differents types of data, and also very used on these ways:
     117{{{
     118#!C
     119void *malloc( unsigned int ); /* function prototype for malloc */
     120
     121string_ptr = malloc(80); /* We call malloc in order to allocate 80 bytes of memory,
     122                            it returns the address obtained, that is copied to the
     123                            string_ptr variable (so, the pointer to this address) */
     124}}}
     125
     126
    114127
    115128
     
    194207
    195208==== Prototype of Functions ====
    196 When there's no arguments for the function, just use the void value
     209When there's no arguments for the function, just put a ''void'' itself inside the (), so for the content of arguments.
    197210
    198211When there's arguments, you should add too a name of variable after it, the mean of this is just to be more easy to understand when reading the headers file for example