Search Results

Showing results 1 to 40 of 57
Search took 0.03 seconds.
Search: Posts Made By: Comatose ; Forum: C++ and child forums
Forum: C++ Mar 30th, 2009
Replies: 9
Solved: C++ instanceof
Views: 1,290
Posted By Comatose
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
Solved: C++ instanceof
Views: 1,290
Posted By Comatose
Here Here!
Forum: C++ Mar 15th, 2009
Replies: 11
Views: 1,277
Posted By Comatose
Forum: C++ Mar 15th, 2009
Replies: 11
Views: 1,277
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
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
Solved: CodeBlocks
Views: 1,417
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
It's missing { }
Forum: C++ Feb 22nd, 2009
Replies: 2
Solved: curses problem
Views: 351
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
How is the linker supposed to know about the object/variables?
Forum: C++ Feb 11th, 2009
Replies: 4
Views: 773
Posted By Comatose
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
Posted By Comatose
sounds like a fun homework assignment.
Forum: C++ Feb 10th, 2009
Replies: 4
Views: 265
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
....

#include <iostream>
#include <iomanip>

using namespace std;


int main(int argc, char **argv)
{
Forum: C++ Jan 31st, 2009
Replies: 4
Views: 458
Posted By Comatose
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
Posted By Comatose
In Code.... All Things Are Possible.
Forum: C++ Jan 31st, 2009
Replies: 2
Views: 500
Posted By Comatose
for (i=0;i<=number;i++)
Forum: C++ Jan 27th, 2009
Replies: 3
Views: 361
Posted By Comatose
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
Solved: For Loop
Views: 403
Posted By Comatose
endl isn't always newline? :icon_eek:
Forum: C++ Jan 27th, 2009
Replies: 5
Solved: For Loop
Views: 403
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
*Quietly Mumbles Quotes From The Bible According To RMS*
Forum: C++ Jan 22nd, 2009
Replies: 5
Views: 841
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
:$ 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
Posted By Comatose
int calcList()
{
std::string inputVal;
int cnt = 0;
int list[100];

while (inputVal != "complete") {
std::cout << "Enter an integer: ";
std::getline(std::cin, inputVal);
Showing results 1 to 40 of 57

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC