I'm very new to C, and I have been watching tutorials about arrays and functions and I started a project.
I have a program that I'm working on shown below, for now, I just want the user to enter x and y values terminated by ctlr Z. The problem is I still don't understand how to relate the function EnterValues inside and outside main(). Note the function EnterValues has arrays inside.
This program is not done, as I'm I'm still adding things to it. The output comes up empty I understand this, because inside main() there is nothing but int i,j; int values; what I want for output is whats under void EnterValues(float dataarray[][MAXDATACOL]).
#include "stdafx.h"
#include "stdio.h"
#define MAXDATACOL 5
int main(void) {
void EnterValues(int dataarray[][MAXDATACOL]);
int i,j;
int values;
while(1);
}
void EnterValues(float dataarray[][MAXDATACOL]) {
for (;;) {
int k = 0, g = 0;
printf("enter the x and y values terminated by ctrl Z\n");
printf("[%d][%d]:",k++,g++);
if (scanf("%f%f",&dataarray[k],&dataarray[g]) == EOF)
break;
}
}