I'm trying to concatenate two string and I cannot use strcpy and strcat, so I'm trying to do this through memcopy. However, on the third statement the memcpy it is not adding on to the continuation of the first memcpy. Any idea how to do this?
memset(&l->db.param_key.param_name, ' ', sizeof(l->db.param_key.param_name));
memcpy(l->db.param_key.param_name,g->program_id_DB,(strlen(g->program_id_DB)));
memcpy(l->db.param_key.param_name[strlen(g->program_id_DB)+1],l->userId_const,sizeof(l->userId_const));
You are giving to the second memcpy the valye of the last array's element. The correct way is to give the address(with the ampersand operator (like it was implicitly meant in the second statement).
memcpy(&l->db.param_key.param_name[strlen(g->program_id_DB)+1],l->userId_const,sizeof(l->userId_const))