I have a program that requires a string to have a null char in the middle of the string (i.e. "Keyword=value\0Keyword=value"
. I am getting the value part of that string from the command line and am having a tough time constructing the string. I do the following:
strcpy(strParam,"Keyword1="
;
strcat(strParam,argv[2]);
What I need to do is keep the NULL character at the end of that string, but add another "Keyword2=" + argv[3] and then add another \0 at the end of the whole thing. I think I should create a pointer to point to the address of the strParam[strlen+1] and then change the pointer, but I'm not sure of the syntax to do this. Any and all help will be appreciated...I'm sure this is simple, it's just been a long time since I worked in C.
strcpy(strParam,"Keyword1="
strcat(strParam,argv[2]);
What I need to do is keep the NULL character at the end of that string, but add another "Keyword2=" + argv[3] and then add another \0 at the end of the whole thing. I think I should create a pointer to point to the address of the strParam[strlen+1] and then change the pointer, but I'm not sure of the syntax to do this. Any and all help will be appreciated...I'm sure this is simple, it's just been a long time since I worked in C.