View Single Post
  #12  
Old 05-26-2004, 09:20 AM
maaltan
Fire Beetle
 
Join Date: May 2004
Posts: 9
Default

hrm .. i think i remember something in the rules about not helping people learn how to code in this forum, maybe a moderator can move this thread to misc or something...


anyway. Im using vc++. i got several compile errors. this is pretty normal. Your code might be fine but vc++ is insane i think .. couple of quick things you might try though

first change your include to :

#include <iostream.h>

and remove the std:: from the stream access commands

so just put:

cin >> blah;

cout << "this is blabhblablabh";

again im rusty when using the iostreams so this might not be correct.

also, i don't think you can use printf formatting keys with the streams. you have to piece together a fully formated string (using sprintf maybe) and pass it to cout. I might be wrong on this .

-------

ok i am editing my post. I just checked out cout

your statement :

cout << " %f\n\n",result; // prints the result

should read:

cout << result << "\n\n"; // prints the result

that makes it work.
Reply With Quote