Forum: C++ Mar 30th, 2009 |
| Replies: 9 Views: 1,290 Nah, in the overridden virtual wage() method, simply put something like cout << "Manager" in the Manager's method, and cout << "Casual" in the Casual's method.
Or make a virtual overridden method... |
Forum: C++ Mar 30th, 2009 |
| Replies: 9 Views: 1,290 |
Forum: C++ Mar 15th, 2009 |
| Replies: 11 Views: 1,277 |
Forum: C++ Mar 15th, 2009 |
| Replies: 11 Views: 1,277 you can't put variables inside double quotes. That means it's a literal string then. You want the value of the variable, so you must take it out of the quotes..... You can't just take it out of... |
Forum: C++ Mar 15th, 2009 |
| Replies: 11 Views: 1,277 you can't concatenate it?
float Pi = 3.14;
system("AdjustSeaLevel.exe " + Pi + " 5.4 11.2 c f g");
or make a variable that contains the string to pass in, and then issue that?
#include... |
Forum: C++ Mar 10th, 2009 |
| Replies: 4 Views: 593 Your loop, where you have buttons[i] = button... yeah, that doesn't create new instances of ButtonFoo. You are taking button[0] and pointing it to button. Then taking button[1] and pointing it to... |
Forum: C++ Mar 9th, 2009 |
| Replies: 4 Views: 701 Just remember scope when playing with those braces. If you declare something inside the braces, it will only exist between the braces:
int main(int argc, char **argv)
{
int a;
{
int a;... |
Forum: C++ Mar 3rd, 2009 |
| Replies: 2 Views: 1,417 You have gcc (The C compiler) installed, but not g++ (The C++ compiler). cc1plus is the binary you need, but it comes bundled with g++ (not gcc). Look for build-essential, or at a prompt apt-get... |
Forum: C++ Mar 1st, 2009 |
| Replies: 12 Views: 645 I wonder if somehow the C++ program is introducing an EOF character prematurely. I strongly doubt it's a crlf \n issue (that is linux uses a different mechanism for new lines than does DOS/Windows).... |
Forum: C++ Feb 22nd, 2009 |
| Replies: 11 Views: 532 |
Forum: C++ Feb 22nd, 2009 |
| Replies: 2 Views: 351 edit curses.h and look around about line 559, and 1017 or so. My copy of curses.h, however includes this:
/* these names conflict with STL */
#undef box
#undef clear
#undef erase
#undef move... |
Forum: C++ Feb 19th, 2009 |
| Replies: 2 Views: 580 At the top of your header, you have:
#ifdef shape_h
#define shape_h that should really be ifndef. Why define it if it is already defined? ;)
Also, you don't have "draw" defined in your class... |
Forum: C++ Feb 15th, 2009 |
| Replies: 6 Views: 2,049 How is the linker supposed to know about the object/variables? |
Forum: C++ Feb 11th, 2009 |
| Replies: 4 Views: 773 You are passing no parameters to the Point class's constructor. It expect 3 floats, during instantiation (Point myLocation). You need to give it three floats. |
Forum: C++ Feb 10th, 2009 |
| Replies: 6 Views: 334 sounds like a fun homework assignment. |
Forum: C++ Feb 10th, 2009 |
| Replies: 4 Views: 265 Look Up Declaring Variables (http://www.devx.com/tips/Tip/16231) and
Basic I/O (http://www.cplusplus.com/doc/tutorial/basic_io.html). That should get you on a roll.... you might even try this link... |
Forum: C++ Feb 10th, 2009 |
| Replies: 4 Views: 265 What code do you have done so far?
EDIT: if your answer is none... start here:
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
// Declare Length, width,... |
Forum: C++ Feb 8th, 2009 |
| Replies: 11 Views: 844 Sorry to back to back post (edit is now gone):
#include <iostream>
#include <cstring>
#include <vector>
using namespace std;
int main()
{
char input[255]; |
Forum: C++ Feb 8th, 2009 |
| Replies: 11 Views: 844 Your while loop, for loop, and cout's, you don't seem to think are part of your int main?
anyway, have you looked at the output of ls -ali? I see the distance between some of the columns in only... |
Forum: C++ Feb 7th, 2009 |
| Replies: 8 Views: 645 Implicit cast to long long int seems to work....(at least on Fedora 8 with g++)
edit: forgot about precision... discard. (you may need to use GMP, if in linux) |
Forum: C++ Feb 7th, 2009 |
| Replies: 11 Views: 844 Other than you have two mains ;)
you need to change the [ ] around the return value of strtok to ( )... don't count on it showing you anything though.... (you have no data output) |
Forum: C++ Feb 2nd, 2009 |
| Replies: 4 Views: 1,184 I suppose you could overload the assignment operator, or some wild nonsense.... why not just make a getter method, and properly encapsulate the variable? |
Forum: C++ Feb 2nd, 2009 |
| Replies: 7 Views: 332 it's because C++ calls the function on the right first, and works its way left. Just add a couple of cout's in your two methods, and see the order in which they are called... getX is called, and... |
Forum: C++ Feb 1st, 2009 |
| Replies: 16 Views: 1,333 No No, I mean, his drawing is bad, so I was unsure if the code was meant to be the way you had it or the way I did. I think he needs what you did however. |
Forum: C++ Feb 1st, 2009 |
| Replies: 16 Views: 1,333 min_lines is not declared, and it makes a pyramid (even spaces on both sides) not a slanted angle tree thing (unless the OP's drawing just sucks, and he really needs a pyramid instead of a slanted... |
Forum: C++ Feb 1st, 2009 |
| Replies: 16 Views: 1,333 ....
#include <iostream>
#include <iomanip>
using namespace std;
int main(int argc, char **argv)
{ |
Forum: C++ Jan 31st, 2009 |
| Replies: 4 Views: 458 I'm going to assume we're talking about windows here, so my first suggestion would be to research how/where the registry gets updated when you put in the WEP password. They have software tools... |
Forum: C++ Jan 31st, 2009 |
| Replies: 4 Views: 458 In Code.... All Things Are Possible. |
Forum: C++ Jan 31st, 2009 |
| Replies: 2 Views: 500 |
Forum: C++ Jan 27th, 2009 |
| Replies: 3 Views: 361 you declare your array as [6] (six elements) but you try to use 7 (0-6). Change your string days to 7 |
Forum: C++ Jan 27th, 2009 |
| Replies: 5 Views: 403 endl isn't always newline? :icon_eek: |
Forum: C++ Jan 27th, 2009 |
| Replies: 5 Views: 403 first, remove the ; after rotate--
second, you can't have an opening { without a closing } (for loop), so add a brace.
third, using rotate > value will for loop until rotate is no longer greater... |
Forum: C++ Jan 25th, 2009 |
| Replies: 3 Views: 324 Also, I never see you call any kind of function to convert the string to an int:
#include <iostream>
#include <sstream>
using namespace std;
int main(int argc, char **argv)
{
stringstream... |
Forum: C++ Jan 25th, 2009 |
| Replies: 5 Views: 448 *Quietly Mumbles Quotes From The Bible According To RMS* |
Forum: C++ Jan 22nd, 2009 |
| Replies: 5 Views: 841 I'm not sure you can put winsock in permiscous mode. I know most sniffers come with like winpcap and what not... |
Forum: C++ Jan 21st, 2009 |
| Replies: 3 Views: 726 In C++ A Struct IS a Class. The only difference is that in a class, the members by default are private. In a Struct, they are by default public. |
Forum: C++ Jan 20th, 2009 |
| Replies: 5 Views: 279 your last else if is missing an opening and closing brace. { }
And in a couple of spots, you are using parenthesis where they should be braces.
#include <iostream>
using namespace std;
int... |
Forum: C++ Jan 19th, 2009 |
| Replies: 6 Views: 1,402 I wonder if the #if (_WIN32_WINNT >= 0x0501) isn't working correctly... (In ws2tcpip.h) |
Forum: C++ Jan 19th, 2009 |
| Replies: 18 Views: 2,864 :$ yup he's right.... std::string is a class, and .c_str() would convert it to a c style string... then the cast would make it the ascii value of the number, not the actual number. Sorry about that. |
Forum: C++ Jan 18th, 2009 |
| Replies: 18 Views: 2,864 int calcList()
{
std::string inputVal;
int cnt = 0;
int list[100];
while (inputVal != "complete") {
std::cout << "Enter an integer: ";
std::getline(std::cin, inputVal); |