#include<stdio.h>
#define msize 4096
struct memory
{
int a[msize];
};
void main()
{
struct memory m;
m.a[0]=250; // temperature value of 25,0
m.a[4]=01; // heater status OFF
m.a[8]=240; // temperature value of 24,0
m.a[12]=00; // heater status ON
m.a[16]=220; // temperature value of 22,0
m.a[20]=00; // heater status ON
read(&m);
}
void read(struct memory m)
{
int i;
for(i=0;i<sizeof(msize);i++)
{
scanf("%d", m.a[i]);
}
}
My code creates a structure of size 4096 bytes, an object for the structure and then assigns values to i.
On compilation, the compiler throws a "first defined here" error in the read
function.
Also, can someone please help me to convert this read value to ASCII?