c++.dos - long and double
- TpW (18/18) Jul 21 2004 What's wrong with my code?
- Jan Knepper (8/32) Jul 21 2004 try:
What's wrong with my code? #include <stdio.h> #include <stdlib.h> #include <string.h> void main(void) { double db; long lg; lg = 316; db = lg+1; printf("lg=%d db=%f\n",lg,db); printf("db=%f\n",db); } dmc -ml test.cpp When execute it show lg=316 db=-23158417847463241000000000000000000000000000000000000000000000000000 0000000000.000000 db=317.000000
Jul 21 2004
TpW wrote:What's wrong with my code? #include <stdio.h> #include <stdlib.h> #include <string.h> void main(void) { double db; long lg; lg = 316; db = lg+1; printf("lg=%d db=%f\n",lg,db);try: printf ( "lg=%ld db=%f\n", lg, db );printf("db=%f\n",db); } dmc -ml test.cpp When execute it show lg=316 db=-23158417847463241000000000000000000000000000000000000000000000000000 0000000000.000000 db=317.000000-- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
Jul 21 2004