User Tools

Site Tools


cplusplus:c_vs._c

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
cplusplus:c_vs._c [2016/04/21 23:16] – [Structs] mithatcplusplus:c_vs._c [2016/04/21 23:17] – [Dynamic memory is different] mithat
Line 90: Line 90:
   * Allocating memory:<code c>   * Allocating memory:<code c>
 int *x = malloc(sizeof(int));          /* allocate a single int */ int *x = malloc(sizeof(int));          /* allocate a single int */
-int *x_arr = malloc(sizeof(int) * 10); /* allocate array of ints */+int *xArry = malloc(sizeof(int) * 10); /* allocate array of ints */
 </code> </code>
  
   * Deallocating memory:<code c>   * Deallocating memory:<code c>
 free(x); free(x);
-free(x_arr);+free(xArry);
 </code> </code>
 ===== Structs ===== ===== Structs =====
cplusplus/c_vs._c.txt · Last modified: 2016/04/22 01:10 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki