Hi,
I am starting to learn C programming. I recently stumbled across a structure below
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct
{
int value;
} fteid_t;
typedef struct {
fteid_t *fteid; // Optional Ins 0
} context_t;
typedef struct {
context_t default_bearer;
} send_request;
So I tried to create a function that can basically assign the value of fteid.value. I believe this is not as simple as fteid.value, because the fteid_t is located inside context_t, and context_t is inside send_request (some sort of list, but no next/prev pointer?)
How can I fix the method below? (I believe the problem is on line 8)
Thank you
void send_Message(send_request *msg)
{
printf("IN THIS BLOCK\n\n");
context_t *fteid = 0;
fteid = malloc(sizeof(context_t));
msg->default_bearer.fteid->value = 1;
free(fteid);
}
int main()
{
send_request *msg = 0;
msg = (send_request *) malloc(sizeof(send_request));
send_Message(msg);
free(msg);
return 0;
}