Well, google-daddy didn't work. I just want to ask source experts out there for some help. I have now become a donkey figuring this one out.
char* mes = "This is a sample message";
char* temp = "{\"q\":\"\"}";
char* mes1 = malloc(strlen(temp) + strlen(mes) + 1);
snprintf(mes1, sizeof(mes1), "{\"q\":\"%s\"}", mes);
ShowInfo("\nMES1: %s\n",mes1);
The output is only this:
It doesn't append everything in place.
I'm playing around with some 3rd party libraries and this is one thing that's blocking me to proceed. I'd really appreciate it if someone could educate me about this.
Question
Ninja
Well, google-daddy didn't work. I just want to ask source experts out there for some help. I have now become a donkey figuring this one out.
char* mes = "This is a sample message"; char* temp = "{\"q\":\"\"}"; char* mes1 = malloc(strlen(temp) + strlen(mes) + 1); snprintf(mes1, sizeof(mes1), "{\"q\":\"%s\"}", mes); ShowInfo("\nMES1: %s\n",mes1);
The output is only this:
It doesn't append everything in place.
I'm playing around with some 3rd party libraries and this is one thing that's blocking me to proceed. I'd really appreciate it if someone could educate me about this.
Edited by NinjaLink to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.