I've been in the library all day and this is like my 3rd program and I just can't get the ball rolling on it.
there's a lot more to this program, hence the header files and whatnot, but right now I am just trying to get this thing to read floats from a file into an array of float type pointers via this function getData.
right now the thing crashes over and over no matter what I change but it compiles fine.
Any help would be greatly appareciated. IF you want to post examples I'd also appreciate it if they were in C for understanding's sake.
Thanks.
Edit: Just treat this as pseudo code as it's pretty hacked atm. I was just trying to assign 1 float into the address in position 0;
Edit Edit: yes I put a semicolon at the end of that cause that's how long I've been doing this today haha...
Code
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void getData(float**);
int main() {
float *array1[20];
float **arrayP;
arrayP = array1;
getData(arrayP);
return 0;
}
void getData(float **array1F) {
int x;
FILE *fp;
fp = fopen("FloatNums.txt", "r");
while ((x = fgetc(fp)) != EOF) {
fscanf(fp, "%f", array1F[0]);
}
fclose(fp);
}
This post was edited by Nom_Nomz on Dec 7 2012 10:02pm