I have following struct
struct connection
{
int *new_socket;
int type;
struct sockaddr_in address;
char *request_line;
};
And I created a pointer of connection
struct like struct connection *con_obj=malloc(sizeof(struct connection))
now I like to allocate space for
con_obj->request_line
Can I do this
*(con_obj->request_line)= malloc(sizeof(char )*val);
or do I need to do this
con_obj->request_line= malloc(sizeof(char )*val);//I don't think so
can anyone please tell this