Search Results

Showing results 1 to 17 of 17
Search took 0.01 seconds.
Search: Posts Made By: Chainsaw
Forum: C++ Jan 11th, 2005
Replies: 97
Views: 25,454
Posted By Chainsaw
This has been a very entertaining discussion!

I love all the "Obviously you have no idea what you are talking about" comments.

I now understand why there is no peace in the Middle East. They...
Forum: Geeks' Lounge Dec 23rd, 2004
Replies: 11
Views: 7,796
Posted By Chainsaw
You are forgetting Einstein!

Einstein said that as you go faster, time seems to slow down for you so that those at 'normal speed' think an hour has gone by but to the faster ones it only seems...
Forum: Computer Science Nov 7th, 2004
Replies: 6
Views: 9,935
Posted By Chainsaw
Heck give it a try and see! I haven't done this in a LONG time, so I may not have 100% of the steps down.
Forum: Geeks' Lounge Oct 26th, 2004
Replies: 155
Read Me: Dani's Cookbook
Views: 46,756
Posted By Chainsaw
Hot Fudge Sauce

Well, Naru contributed breakfast, Kc dinner. Here's dessert....


class AHotFudgeSauce : public ARecipe
{
protected:
// ingredients
EvaporatedMilk m_milk; //...
Forum: C++ Sep 22nd, 2004
Replies: 2
Views: 1,891
Posted By Chainsaw
The linker can remove unreferenced functions too. In VC, under Project Settings/"c/c++"/Customize there's a checkbox called "Enable function-level linking."

Check it, and unreferenced functions...
Forum: C++ Sep 16th, 2004
Replies: 7
Views: 2,109
Posted By Chainsaw
Ah, and here all this time I've been thinking of pass by reference as the same as pass by pointer, but with the compiler hiding the pointer syntax from you. :0)

Yeah, bottom line is that the...
Forum: C Sep 13th, 2004
Replies: 3
Views: 2,063
Posted By Chainsaw
rather than

printf("Greetings!\n");

You could use:

const char* greeting = "Greetings!\n";

printf( greeting );
Forum: C++ Sep 13th, 2004
Replies: 6
Views: 2,439
Posted By Chainsaw
the first statements uses logical and (&&) the second uses bitwise and (&), so you might try using '&&=' in the second statement.

The difference might be subtle; say the input_val was '2'. In the...
Forum: C++ Sep 7th, 2004
Replies: 3
Views: 1,843
Posted By Chainsaw
Compilers are usually set up to compile files with ".c" extensions as C and ".cpp" as C++; so if you are going to add C++ only stuff, the first thing to do is rename your .c files as .cpp. (and...
Forum: C++ Sep 6th, 2004
Replies: 14
Views: 5,392
Posted By Chainsaw
It looks like the part starting with

{
double hours[CARS]

is intended to be the main() routine? And then it calls that other routine and passes in hours?

(also, don't forget the semicolon...
Forum: C++ Sep 6th, 2004
Replies: 5
Views: 2,973
Posted By Chainsaw
To help organize your thoughts, how about:

display a prompt to get the file name
read the filename from the console

display a prompt to get the mode (read/write)
read the mode from the...
Forum: C Aug 30th, 2004
Replies: 6
Views: 7,406
Posted By Chainsaw
Huh? It sounds like the assignment is, given a node in the target list, insert a new node into it. Otherwise you'd have an assignment like "insert in sorted order"

So, given a target node called...
Forum: C Jul 12th, 2004
Replies: 32
Views: 47,257
Posted By Chainsaw
Check out 'strtok()'; it will parse a string, stopping on one or more tokens; in this case your ':'.

The strings you parse could be referenced by an array of string pointers:


const char*...
Forum: C++ Jul 7th, 2004
Replies: 14
Views: 3,488
Posted By Chainsaw
Although I realized after posting that, what you WANTED to know was how to make a reference to a class....

AClass classInstance;
AClass *pClassInstance; // pointer to the class
AClass...
Forum: C Jun 26th, 2004
Replies: 3
Views: 19,142
Posted By Chainsaw
If you know the window to send them to, you can use WM_MOUSEMOVE and WM_MOUSEACTIVATE. But you have to know the HWND. One way to do that is to use EnumWindows and EnumChildWindows to find the...
Forum: C Jun 21st, 2004
Replies: 12
Views: 15,470
Posted By Chainsaw
How about:

int is_prime_helper( int n, int test )
{
if (test < 2) return 1;
if (!(n%test)) return 0;
return is_prime_helper(n,test-1);
}

int is_prime(int n,int p)
Forum: C++ Jun 17th, 2004
Replies: 5
Views: 35,085
Posted By Chainsaw
Not sure I understand the request, but using new for dynamic arrays goes like this:

void CreateArray( int numberToCreate )
{
// this allocates space and calls the constructor on each...
Showing results 1 to 17 of 17

 


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

©2003 - 2009 DaniWeb® LLC