C++ - adding a double/int to a char array / string
Posted on 2006-11-22
I'm strictly an asp/vb developer but a current project requires that i work with some C++ code. I have what i imagine is a really simple problem, but can't seem to get round it.
i have a function that takes a string/char array as input:
i also have a value stored in a double:
double dansValue = 123456;
what i want to do is add the value in the dansValue double to the char array / string that is sent to DansFunc. so in the above example it will result in:
DansFunc("hello 123456 world")
in vb this would just be DansFunc("hello " & dansValue & " world")
can anyone tell me how to do the equivalent in C++ ???
Please also bear in mind that you will need to give me the code to include any needed headers, as i won't know what they are.
This is really urgent, so 500 points up for grabs.