I want to write a function in C language which returns the 2 dimension array to my main function.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A function that returns a dynamically allocated two dimensional array for the
inttype.It has to be deleted with
freeonce it is not used anymore.EDIT This only allocates the space for the array which could be accessed by pointer arithmetic but unfortunately not by the index operators like
array[x][y].If you want something like this here is a good explanation. It boils down to something like this: