Why on earth are you pissing away resources using a String?
Maybe not everybody (ok, me) is as experienced as you. I come here asking for help and hoping to learn, not to get flamed for doing something the wrong way. I am doing it that way because I don't know how else to do it. In addition, they are my resources to piss away.
The last part of your statement makes no sense
Ok, me being not overly intelligent here, but what statement? The 'statement' in the code? The third line? What don't you understand?
There is a chance, and that would be a very high chance that I don't know what I am doing and don't know how to ask the question correctly due to my lack of experience.
May I very politely suggest that, as your reply to my post is absolutely useless to me (has not answered anything at all) that you refrain from replying unless you are actually going to answer the question, or ask for clarification so you can better understand the question?
Really sorry for my rant.
After all that, I believe I need to use vsprintf instead of sprintf.
gjt211:
After all that, I believe I need to use vsprintf instead of sprintf.
it will hard to create va_list. I suggest to change the building of the format string to building the final string with using sprintf for one variable at a time
Hi Juraj, thanks for your input.
I have been trying to work out how to create the va_list. No good results so far.
I was starting to think if I pass in the va_list in an array it might work but have not got that far yet.
I was also thinking of building it one variable at a time but was hoping not to have to.
I might end up going that way.
gjt211:
Hi Juraj, thanks for your input.
I have been trying to work out how to create the va_list. No good results so far.
I was starting to think if I pass in the va_list in an array it might work but have not got that far yet.
I was also thinking of building it one variable at a time but was hoping not to have to.
I might end up going that way.
the va_list is to process the ... args. it is very tricky.
btw: nor do I understand what PaulS does not like on how you use sprintf in the test example
Thanks for the kind words Juraj.
I can get a vsprintf with fixed va_args to work but still gives me the same problem to solve that I started with.
In the interests of moving on, I think I will just build it one at a time as suggested so I can get on with the rest of the project.
Thanks again.