B
Brian Stubblefield
Dear group,
I am a beginner to C.
Below is a segment of a program that I am trying to debug:
#include <stdio.h>
#include <signal.h>
/*#include <stdlib.h>*/
#define BIT char
int main(void)
{
/* editted code */
void *p;
char rec1_io[81] = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '
', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '
', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '
', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '
', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '
', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '
', ' '};
p = &(rec1_io);
struct RECIN1 {
char pgm[10];
char rec_type[2];
char filler[4];
char form[6];
char filler1[59];
} **recin1_struct =&p;
/* editted code */
When I compile this code, I received the following error message
pertaining to the struct statement:
warning: initialization from incompatible pointer type
Can somebody please recommend a better way that the above code can be
accomplished or fixed?
Thank you in advance,
Brian
I am a beginner to C.
Below is a segment of a program that I am trying to debug:
#include <stdio.h>
#include <signal.h>
/*#include <stdlib.h>*/
#define BIT char
int main(void)
{
/* editted code */
void *p;
char rec1_io[81] = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '
', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '
', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '
', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '
', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '
', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '
', ' '};
p = &(rec1_io);
struct RECIN1 {
char pgm[10];
char rec_type[2];
char filler[4];
char form[6];
char filler1[59];
} **recin1_struct =&p;
/* editted code */
When I compile this code, I received the following error message
pertaining to the struct statement:
warning: initialization from incompatible pointer type
Can somebody please recommend a better way that the above code can be
accomplished or fixed?
Thank you in advance,
Brian