i have a 2d array that's array and a double number. I want to put that number into the 1st line of the array how will i do that?

array=number; does not work, is there a simple way of converting it?

for instance

double number;
double list
number=5.35
i want to make

Heres the code that i tried

``````#include <stdio.h>

int main ()
{
char word;
double num;
double number;
FILE*myin;
myin=fopen("first.dat","r");
fscanf(myin,"%s",&word);
fscanf(myin,"%lf",&num);
printf("%s\n%lf",word,num);
number=num;
fclose(myin);
return(0);
}``````

i'm still confused, the thread sets an array = to another array, what i want to do is set an array = to a (double) number

If what you mean is that you want to fill list through list with 5.35f, then use a for loop and assign 5.35f to each int from 0 through 9 on row 0.

You define the TWO 2D arrays, but then you handle them like 1D vectors. Is that what you want to do?

``double number;``

. . .

``number=num;``

. . .

If you want to assign num to array element (0,0), you should state it like this:

``number=num;``

thanks, i somehow got it fixed!