I have Data.C
:
#include "Data.h"
char data_a[999][999];
Data.h
:
#ifndef Data_h
#define Data_h
#include <stdio.h>
extern char data_a[999][999];
#endif /* Data_h */
And then Main.c
:
#include "Data.h"
char *s;
...
printf("Write -%s- to -%d-\n",s,counter_a);
printf("BEFORE -%c-\n",data_a[counter_a][0]);
data_a[counter_a][0]=*s;
printf("AFTER -%c-\n",data_a[counter_a][0]);
And when Main.c
is run this is what is printed as an example:
Write - This is my sample string I want to save to the array at position 166
- to -166-
BEFORE --
AFTER - -
What I am trying to do is have data_a[166][0]
be equal to the value of s
which should be "This is my sample string I want to save to the array at position 166"
. I know I have something not quite right, just need a nudge in the right direction.