Home > SparkNotes > Computer Science Study Guides > Why Use Pointers? >

sparknotes

Why Use Pointers?


Problems

Problem : Write a function which takes an integer n, allocates space for a string of n characters, and returns a pointer to that space.


Problem : Write a function which allocates an array of n integers, where n is a parameter to the function.


Problem : Write a function int **create_2d_array(int x, int y) which allocates a two-dimensional array of size x by y and returns a pointer to it.