Forum: C++ Jul 31st, 2009 |
| Replies: 11 Views: 489 y-intercept? What?
y = mx + b is a linear function. What are these 'four ys' and 'four xs'? |
Forum: C++ Feb 12th, 2008 |
| Replies: 7 Views: 627 it should read: cout << "yarg!" << endl; instead. |
Forum: C++ Feb 12th, 2008 |
| Replies: 11 Views: 964 >What medium do you want to draw it on...
Considering his lack of information, I think it's safe to assume the medium is a terminal.
I repeat, you must draw it yourself. |
Forum: C++ Feb 12th, 2008 |
| Replies: 11 Views: 964 You must draw it "bymyself." |
Forum: C++ Jan 27th, 2008 |
| Replies: 7 Views: 2,315 The = is an assignment operator. Use == instead. Your code would still need some fixing, but I'm sure you can figure that out. |
Forum: C++ Dec 11th, 2007 |
| Replies: 13 Views: 5,007 You realize these are just DOS commands? Oh and btw, none of your commands work on *my* computer, I wonder why that is. |
Forum: C++ Dec 2nd, 2007 |
| Replies: 2 Views: 2,268 |
Forum: C++ Dec 2nd, 2007 |
| Replies: 2 Views: 2,268 For homework I'm apparently supposed to implement some functions defined in <algorithm> . So this is what I have so far:
template <class I> bool m_equal( I b, I e, I b2 ) ... |
Forum: C++ Nov 27th, 2007 |
| Replies: 5 Views: 1,458 Or a little little easier:
int round(const double& c)
{
if (c - (int)c > .5)
return (int)c + 1;
else
return (int)c;
} |
Forum: C++ Nov 26th, 2007 |
| Replies: 5 Views: 1,223 Why are you using graphics.h ? Real programmers(tm) use a real API such as SDL, Allegro, or ClanLib. |
Forum: C++ Nov 22nd, 2007 |
| Replies: 3 Views: 801 1. Get a better compiler. (Dev-Cpp (http://www.bloodshed.net/devcpp.html), Code::Blocks (http://www.codeblocks.org/))
2. Get a better graphics API. (SDL (http://www.libsdl.org/), ALLEGRO... |
Forum: C++ Nov 21st, 2007 |
| Replies: 8 Views: 1,705 Why are you erasing anything in the first place?
here's the idea:
1. Increment an iterator until isspace() is false.
2. Increment another iterator until isspace() is true. You now have a word.... |
Forum: C++ Nov 21st, 2007 |
| Replies: 8 Views: 1,705 |
Forum: C++ Nov 21st, 2007 |
| Replies: 8 Views: 1,705 Instead of doing all this crap with the string, why not just create a new string? isspace() is your friend. |
Forum: C++ Nov 21st, 2007 |
| Replies: 5 Views: 620 So what's the problem? (besides your bad code) |
Forum: C++ Nov 15th, 2007 |
| Replies: 13 Views: 1,194 >ill take a look at Acceralted C++ - i dont like the "in 21 days" books - the only one of them which i ever got on with was the SQL one, that was excellent
I bought accelerated c++ a few months (I... |
Forum: C++ Nov 10th, 2007 |
| Replies: 9 Views: 656 >Num goes in here??
If num goes there, why did you pass b , an uninitialized variable with a random value? |
Forum: C++ Nov 10th, 2007 |
| Replies: 9 Views: 656 Do you know what a scope is?
Your getFib() function can't magically get variable values from your main function. |
Forum: C++ Nov 10th, 2007 |
| Replies: 9 Views: 656 Since b is unitialized, the value of b could be *anything.*
>But the main problem I have is that when num goes to getFib() it becomes a very strange number thats nothing close to what I input to... |
Forum: C++ Nov 10th, 2007 |
| Replies: 9 Views: 656 Well... what seems to be wrong with these 2 lines:
long double b;
getFib(b); |
Forum: C++ Nov 8th, 2007 |
| Replies: 13 Views: 3,377 You could turn off terminal echoing. |
Forum: C++ Oct 26th, 2007 |
| Replies: 9 Views: 2,535 Were you using devpaks? If not, I suggest you try it as generally it's quite easy to install devpak libraries. http://devpaks.org/category.php?category=SDL |
Forum: C++ Oct 21st, 2007 |
| Replies: 5 Views: 740 |
Forum: C++ Oct 21st, 2007 |
| Replies: 5 Views: 740 First of all, you should use classes. In addition to this you should use vectors instead of strings. And third, you should make your program platform inpedendent. This means not using system() .
... |
Forum: C++ Oct 21st, 2007 |
| Replies: 6 Views: 2,035 for ( int c = 7; c < i; c += 2)
cout << c << "\n"; |
Forum: C++ Oct 14th, 2007 |
| Replies: 10 Views: 6,392 try:
#include "SDL/SDL.h" |
Forum: C++ Oct 8th, 2007 |
| Replies: 2 Views: 1,250 I don't believe so, but there is a C compiler (http://hpgcc.org/) for the hp-50g (A much superior calculator if I may interject my own opinion) |
Forum: C++ Oct 8th, 2007 |
| Replies: 3 Views: 1,764 Let me guess: Your using visual c++ 6 and some subpar textbook that uses outdated headers. The class is taught by some loser who is too stupid to get a real job actually programming. In fact judging... |
Forum: C++ Oct 2nd, 2007 |
| Replies: 5 Views: 2,322 You need to seed rand. srand (time(0)) ( it uses ctime I think so include that) |
Forum: C++ Oct 1st, 2007 |
| Replies: 14 Views: 1,507 Are most computer science professors that incompetent? |
Forum: C++ Oct 1st, 2007 |
| Replies: 14 Views: 1,507 Airline homework problem? Whats that? |
Forum: C++ Sep 17th, 2007 |
| Replies: 3 Views: 658 output:
cout << "Hello, World\n"; // '\n' returns the line
input:
cin >> var1; //sets var1 to the user input (most of the time) |
Forum: C++ Sep 17th, 2007 |
| Replies: 18 Views: 1,562 |
Forum: C++ Sep 17th, 2007 |
| Replies: 18 Views: 1,562 just use Ancient Dragon's code but replace Sleep(1000) with Sleep(90000). |
Forum: C++ Sep 16th, 2007 |
| Replies: 2 Views: 863 |
Forum: C++ Sep 16th, 2007 |
| Replies: 18 Views: 1,562 while(true)
{
system("<yourcommand here>");
Sleep(90000);//have to include windows.h I think
} |
Forum: C++ Sep 16th, 2007 |
| Replies: 5 Views: 795 You should probably just create a struct that stores the name of the person and their score. Then store the the bowler struct in a vector. |
Forum: C++ Sep 9th, 2007 |
| Replies: 6 Views: 3,846 -Id:/dev-c++/include/gtkmm-2.4
-Id:/dev-c++/lib/gtkmm-2.4/include
-Id:/dev-c++/include/gtk-2.0
-Id:/dev-c++/lib/sigc++-2.0/include
-Id:/dev-c++/include/sigc++-2.0
... |
Forum: C++ Sep 8th, 2007 |
| Replies: 6 Views: 3,846 Try rebooting to update your path (I don't have access to a windows machine currently). If that doesn't work you could manually locate all of the necessary files. |
Forum: C++ Sep 8th, 2007 |
| Replies: 6 Views: 3,846 http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/ape.html
What doesn't work? |