Is there an equivalent to the strcpy function, for floating point numbers, and integer values?
Thanks.
Is there an equivalent to the strcpy function, for floating point numbers, and integer values?
Thanks.
For floats and ints you just assign the values from one variable to another directly.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
sprintf(buff, "This works %.2f%% of the time...\n", 100);
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
You have memcpy that copies a group of bytes but you
have to be careful with this one. Often times
you might find yourself writing code like this
int a[100]
int b[100];
memcpy(a, b, 100); But what you really wanted was
memcpy(a, b, 100 * sizeof (int)).
One question, three different answers. Maybe unreg better rephrase the question in order to clarify what they want to know. Or better still, show a snippet of code they are having trouble with.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
>One question, three different answers.
It sounds like Nick's answer was the most correct for the question.
-Prelude
My best code is written with the delete key.