i have a 2d array that's array[10][10] and a double number. I want to put that number into the 1st line of the array how will i do that?
array[0]=number; does not work, is there a simple way of converting it?
for instance
double number;
double list[10][10]
number=5.35
i want to make
list[0] = 5.35 basically filling the first line. Please help, thanks
Heres the code that i tried
#include <stdio.h>
int main ()
{
char word[10][10];
double num;
double number[10][10];
FILE*myin;
myin=fopen("first.dat","r");
fscanf(myin,"%s",&word[0]);
fscanf(myin,"%lf",&num);
printf("%s\n%lf",word[0],num);
number[0]=num;
fclose(myin);
return(0);
}