Hi guys, first time posting here so I just want to thank anyone in advance for any help that I might receive. I wish I had known about this forum earlier. Anyway, let me get to it. I am to write a program that lets the user specify the number of rows to be used in the array. More specifically:
Main will make the following function calls:
1. The first function will allow the user to specify the number of names in the list to be sorted. (Maximum 16 names can be in the list)
That is from the lab assignment that my instructor has given me. There is a lot more to the program, but this is the first step, and I am having trouble with it.
Here is my code so far.
Code:
#include <stdio.h>
#include <stdlib.h>
//// PROTOTYPE DECLARATIONS ////
int **buildTable (void);
int main (void) //// BEGIN MAIN
{
int **buildTable (void); // <-Call to buildTable Function
return 0;
}
int **buildTable (void) //// BEGIN buildTable Function
{
int **table;
int rowNum, row;
printf("Enter the number of rows in the table: \n");
scanf("%d", &rowNum);
table = (int **)calloc(rowNum +1, sizeof(int*));
if(!table) return NULL;
table[row] = NULL;
return table;
}
When I compile it, I get no errors or warnings, but it does not print anything to the screen. What am I doing wrong here?