|
-
Jul 29th, 2001, 03:07 PM
#1
Thread Starter
Lively Member
Square Root - sqrt?
Hi!
I'm very new to VC++ and need to get the square root of a number.
In VB i would use Sqrt(n)... but how in VC++?
I am making an MFC application.
-
Jul 29th, 2001, 03:17 PM
#2
Monday Morning Lunatic
Are you new to C++ or Windows programming with C++ I would SERIOUSLY suggest if the former, that you learn the language before trying to use MFC. Actually, scrap MFC altogether and use the API But in answer to your question...
Code:
#include <iostream>
#include <cmath>
using namespace std;
int main() {
float fNum = 5.4f;
cout << sqrt(fNum) << endl;
return 0;
}
http://www.cplusplus.com/ref/cmath/sqrt.html
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jul 29th, 2001, 03:51 PM
#3
Thread Starter
Lively Member
-
Jul 29th, 2001, 03:56 PM
#4
Monday Morning Lunatic
Just don't trip up on pointers and inheritance which is something that MFC uses in spades and can really mess you up.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|