How do i use doubles? I use them with pre-defined values but when I try to get one from a scanf("%f",var); prompt and it doesnt seem to work? can anyone suggest what difference i need to use compared to a float variable?
pants! Ithought it was "%d" (again fom memory - got it wrong ) Size Prefixes for scanf and wscanf Format-Type Specifiers To specify Use prefix With type specifier double l e, E, f, g, or G long double (same as double) L e, E, f, g, or G long int l d, i, o, x, or X long unsigned int l u short int h d, i, o, x, or X short unsigned int h u __int64 I64 d, i, o, u, x, or X Single-byte character with scanf h c or C Single-byte character with wscanf h c or C Wide character with scanf l c or C Wide character with wscanf l c, or C Single-byte – character string with scanf h s or S Single-byte – character string with wscanf h s or S Wide-character string with scanf l s or S Wide-character string with wscanf l s or S
if its a scanf issue then surely its because your passing a value, not a pointer. like so scanf("%f",&dVar);
Good point, except use %lf (as described on MSDN) or described here: http://www.cplusplus.com/ref/cstdio/scanf.html
sorry to confuse you all but i meant to put a % in front of the var name i did the %lf thing and it works ... no problems there. i later compiled my program with GCC and %lf gave me a warning because its not strictly ANSI C
the nice thing about standards is there are soo many to choose from. C comes in many flavours, thats the horrible thing about it java/.net excite me, native CPU support can be very fast. JIT'ing is very fast too, but i'd like to see more people using languages that compile to a VM, then cross compile to a localised binary.
Animus if you get experience of using NGEN on different platforms I'd be interested to hear what you find. The company I'm currently working for refuse to allow it so I've not been able to try it in anger....
Well, that depends on the what you are trying to do. You wouldn't want to create a graphics rendering engine running interpreted, especially for a web server with thousands of hits per day. Everything has it's time and place.